Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Another: NSString Compare Not Working in Objective-C

Tags:

objective-c

I'm trying to use the IsEqualToString method (which I have used succesfully before). But I get the following error:

-[NSCFString IsEqualToString:]: unrecognized selector sent to instance 0xa055e7b0

Here is the code:

@interface EditHabitViewController : UIViewController<UITableViewDataSource,UITableViewDelegate> {

NSString *contactId;
}
@property (nonatomic, retain) NSString *contactId;


-(void)updateContactInfo {
NSString *sSQL = @"";
NSString *sCheck= self.contactId;

// nothing to load? then leave: 
if ([sCheck IsEqualToString: @"0"]) {
    return;
} // end if

Notice that both sCheck and contactId are both declared as NSString. This is driving me crazy!

Any help would be greatly appreciated.


1 Answers

You have some errant capitalization in IsEqualToString:-- try isEqualToString: instead.

like image 195
Marc Charbonneau Avatar answered Feb 16 '26 02:02

Marc Charbonneau