【发布时间】:2011-05-03 23:26:07
【问题描述】:
我找不到解决以下代码内存泄漏的方法。请帮忙。
// Data Transfer from pList and temp & dict Creation ---------------------------------------------
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // pool is created
//Path get the path to Data.plist
NSString *path=[[NSBundle mainBundle] pathForResource:@"Data" ofType:@"plist"];
//Next create the temp dictionary from the contents of the file
NSMutableDictionary *temp=[NSMutableDictionary dictionaryWithContentsOfFile:path];
//Copy from temp and init dict
dict = [[NSMutableDictionary alloc]initWithDictionary:temp];
[pool drain];
【问题讨论】:
标签: objective-c memory-management nsmutabledictionary