Created
November 22, 2009 15:35
-
-
Save leontiy/240607 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString * path = [[NSBundle mainBundle] pathForResource:<#Resource name#> ofType:@"plist"]; | |
NSData * plistXML = [[NSFileManager defaultManager] contentsAtPath: path]; | |
NSString * errorDesc = nil; | |
NSPropertyListFormat format; | |
<#Variable name#> = (<#Type of top level element#> *)[NSPropertyListSerialization propertyListFromData:plistXML mutabilityOption:NSPropertyListImmutable format:&format errorDescription:&errorDesc]; | |
if (nil == <#Variable name#>) { | |
NSLog(@"Can not load <#What#>."); | |
if (errorDesc) { | |
NSLog(@"Error description: %@", errorDesc); | |
[errorDesc release]; errorDesc = nil; | |
} | |
<#more error handling#> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment