0
votes

I am trying to figure out how to use bools in objective c. when i use them though they occasionally give a warning. Here is the code i have

NSString *userUserName = userNameTextField.text;
bool *userNameIsGood = false;
if (userNameTextField.text.length > 0){
    userNameIsGood = true;  // warning is only on this line
}
else {
    userNameIsGood = false;
}

the warning i get is: "Incompatible integer to pointer conversion assigning to 'bool *' from 'int'

thank you

1

1 Answers

1
votes

try replace

bool *userNameIsGood = false;

to

bool userNameIsGood = false;

or

bool *userNameIsGood;

if (userNameTextField.text.length > 0){
    *userNameIsGood = true;  // warning is only on this line
}
else {
    *userNameIsGood = false;
}