NSDictionary - Read BOOL from Internet-Downloaded Plist

Posted by David Schiefer on Stack Overflow See other posts from Stack Overflow or by David Schiefer
Published on 2010-04-30T16:45:02Z Indexed on 2010/04/30 16:47 UTC
Read the original article Hit count: 970

Filed under:
|
|
|

Hi,

I am downloading a PLIST file from my server using NSURLDownload. Once it is downloaded, I read the file using NSDictionary's dictionaryWithContentsOfFile: method. I need to read a BOOL value, so this is my code:

if ([dict objectForKey:string] == [NSNumber numberWithBool:YES])

This however always returns NO, no matter what the value is. The same happens if I replace the == with isEqual:.

Am I doing this wrong?

© Stack Overflow or respective owner

Related posts about nsdictionary

Related posts about bool