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