我的方法是
-(void)readAppFile
{
NSString *plistPath = [self getDataFileDestinationPath];
NSData *plistXML = [[NSFileManager defaultManager] contentsAtPath:plistPath];
NSString *errorDesc = nil;
NSPropertyListFormat format;
NSMutableDictionary *temp = (NSMutableDictionary *) [NSPropertyListSerialization propertyListFromData:plistXML mutabilityOption:NSPropertyListMutableContainersAndLeaves format:&format errorDescription:&errorDesc];
if (!temp) {
NSLog(@"Error reading plist: %@, format: %d", errorDesc, format);
}
items = [[temp objectForKey:@"Items"] mutableCopy];
NSLog(@"temp %lu", (unsigned long)[temp retainCount]);
[temp release];
}
当我添加[temp release];
- 但出了点问题并且我的方法崩溃了。不明白出了什么问题..正如我从内存泄漏工具中看到的那样 - 我需要释放这个变量..有什么帮助吗?