我正在開發的iOS應用程序,現在要測試它的內存泄漏問題,我已經使用了內存泄漏IOS /目標C
鐺靜態分析器
及其給我這個bug報告
-(void)pass
{
printf("reading plist info");
// Path to the plist (in the application bundle)
NSString *path = [[NSBundle mainBundle] pathForResource:
@"sortednames" ofType:@"plist"];
// Build the array from the plist
NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path];
for (id key in dict) {
NSLog(@"bundle: key=%@, value=%@", key, [dict objectForKey:key]);
string_values=[dict objectForKey:key];
//NSLog(@"bundle data: key=%@, value=%@", key, [string_values objectAtIndex:0]);
}
//[dict release];
}
,分析儀提供的信息是
和一件事更多 是否足以用於我的應用程序的內存管理?
或我必須做更多的工作?
感謝答覆
你爲什麼取消註釋'[字典釋放];'? – yinkou 2013-02-27 12:31:24
當我取消註釋它>>該應用程序崩潰,無法繼續進行 – 2013-02-27 12:32:50
使用'autorelease'。 'NSDictionary * dict = [[[[NSDictionary alloc] initWithContentsOfFile:path] autorelease];' – CainaSouza 2013-02-27 12:44:21