tags:

views:

30

answers:

2
NSUserDefaults *profiles = [NSUserDefaults standardUserDefaults];

if([[profiles stringForKey:@"approvalline1"] isEqualToString:@"Approval"] == YES) {
    [picker selectRow:1 inComponent:0 animated:NO];
} 

if([[profiles stringForKey:@"approvalline1"] isEqaulToString:@"Disapproval"] == YES) {
    [picker selectRow:2 inComponent:0 animated:NO];
}

The first if statement runs fine - but when I add that second statement I get 2 errors that say, "NSString may not respond to '-isEqualToString'" AND "Comparison between pointer and integer"

??Weird??

+1  A: 

I'm not sure if you copy-pasted or not, but if you did, you've got a typo in the second if-statement:

"isEqaulToString"

arid1
+2  A: 

isEqaulToString is spelt wrong in the second example.

Because it doesn't know what isEqaulToString method is, it has to assume the return type, which is why you get the second message.

dannywartnaby