check if(country == @"(null)" doesn't work

Posted by Sean on Stack Overflow See other posts from Stack Overflow or by Sean
Published on 2010-03-31T15:30:46Z Indexed on 2010/03/31 15:33 UTC
Read the original article Hit count: 504

Filed under:
|
|
|

hi all,

I got the problem that the if-statement doesn't work. After the first code line the variable contains the value "(null)", because the user who picked the contact from his iphone address book doesn't set the country key for this contact, so far so good.

but if I check the variable, it won't be true, but the value is certainly "(null)"... does someone have an idea?

 NSString *country = [NSString [the dict objectForKey:(NSString *)kABPersonAddressCountryKey]];

 if(country == @"(null)")
 {
      country = @"";
 }

thanks in advance
sean

© Stack Overflow or respective owner

Related posts about if-statement

Related posts about null