:
#import <Foundation/Foundation.h>
#import <err.h>
int main(int argc, const char * argv[])
{
@autoreleasepool {
NSString *path = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:argv[1] length:strlen(argv[1])];
NSData *data = [NSData dataWithContentsOfFile:path];
if (!data)
errx(EXIT_FAILURE, "open failed: %s\n", argv[1]);
NSString *errorString;
id plist = [NSPropertyListSerialization propertyListFromData:data
mutabilityOption:NSPropertyListImmutable
format:NULL
errorDescription:&errorString];
if (!plist)
errx(EXIT_FAILURE, "%s\n", [errorString UTF8String]);
printf("plist successfully read\n");
}
return 0;
}
project.pbxproj:
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
x = 1
};
...
:
2012-05-11 20: 51:14.381 plist-test [41890: 303] CFPropertyListCreateFromXMLData(): : 6. . _CFPropertyListMissingSemicolon .