1
我到这儿泄漏这是写在appDelegate.m如何解决下面代码中的泄漏?的ObjectiveC
-(NSMutableArray*)getSalutationList
{
NSMutableArray *list=[[NSMutableArray alloc]init];
[list addObject:@"Dr."];
[list addObject:@"Mr."];
[list addObject:@"Mrs."];
[list addObject:@"Miss."];
[list addObject:@"Ms."];
return list; //return [list autorelease]; if i keep this i am getting exception.
}
如何释放名单,也是我需要它,我从视图控制器调用的内容。
你如何使用'-getSalutationList'的返回值? – kennytm 2010-06-25 16:00:15
listformAppdelegate = [appDelegate getSalutaionList];并且此列表用于显示View Controller中的内容。 – 2010-06-26 05:27:54