草庐IT

gastrocategory

全部标签

iphone - 如何在for循环中释放一个对象?

我是cocoa/objective-c的新手,我正在为我的对象的发布而苦苦挣扎。我有以下代码:gastroCategoryList=[[NSMutableArrayalloc]init];for(NSDictionary*gastrocategoryingastrocategories){NSString*oid=[gastrocategoryobjectForKey:@"id"];GastroCategory*gc=[[GastroCategoryalloc]initWithId:[oidintValue]name:[gastrocategoryobjectForKey:@"name