tags:

views:

530

answers:

2

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.

+8  A: 

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

Marc Charbonneau
I can't believe I missed that!! Thanks so much, my code works now!
A: 

SWEEET! I has taken me forever to figure this one out.

Trying to compare 2 different Objective-C NSStrings is such a pain.

What happen to the old:

if(myNSString == @"Hello") { //do something }

Why is this so difficult?

4GivenSoftware.com