+ (NSDictionary *)readFromArchive:(NSString *)aFileName {
NSString *errorDesc = nil;
NSPropertyListFormat format;
NSString *plistPath = [[NSBundle mainBundle] pathForResource:aFileName
ofType:@"plist"];
NSData *plistXML = [[NSFileManager defaultManager]
contentsAtPath:plistPath];
NSDictionary *temp = (NSDictionary *)[NSPropertyListSerialization
propertyListFromData:plistXML
mutabilityOption:NSPropertyListMutableContainersAndLeaves
format:&format errorDescription:&errorDesc];
if (!temp) {
NSLog(@"%s at line %d with message: %@", __FUNCTION__, __LINE__, errorDesc);
}
return temp;
}
时间: 2024-09-30 20:55:44