我是 iPhone 开发的新手。这是我的代码:
- (void)setImage:(UIImage *)image ImageKey:(NSObject *)imageKey
{
NSNumber *number=(NSNumber*)imageKey;
int num=[number intValue];
UIScrollView *scrollViewFamily=(UIScrollView*)[scrollViewProfile viewWithTag:6];
UIButton *btnPhoto=(UIButton*)[scrollViewFamily viewWithTag:num];
[btnPhoto setImage:image forState:UIControlStateNormal];
Photo *aPhoto= [appData.CurrentUser.familyListarray objectAtIndex:num-1000];
aPhoto.photoImg=image;
}
scrollview retainCount 是 3,按钮 2 和 aPhoto 1。现在我的问题是这样写是否正确?如果是,那么如何释放这些对象?帮帮我。谢谢...