how to check if NSString = a specific string value?

C.Johns picture C.Johns · Sep 1, 2011 · Viewed 45.3k times · Source

Hi I am woundering if you can check to see if a NSString equals a specific value say for instance a name of a person?

I am thinking along the lines of

if (mystring == @"Johns"){
    //do some stuff in here
}

Answer

Vanya picture Vanya · Sep 1, 2011
if ([mystring isEqualToString:@"Johns"]){
    //do some stuff in here
}