Orv
Orv

Reputation:

Another: NSString Compare Not Working in 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.

Upvotes: 2

Views: 1831

Answers (1)

Marc Charbonneau
Marc Charbonneau

Reputation: 40517

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

Upvotes: 10

Related Questions