我有一个方法并且不使用 ARC:
-(void)readAppPlist
{
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: %@, formatL %d", errorDesc, format);
}
items = [[temp objectForKey:@"Items"] mutableCopy];
}
根据内存管理的规则,我需要在哪里释放变量 plistPath、plistXML、errorDesc、temp 的内存?我应该使用另一种方法,在此处释放它们还是将它们放入此类的 dealloc 全局方法中?