I am new to iPhone Development.
here is my code :
- (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 is 3,for button 2 and aPhoto for 1.
now my question is that is it right to write ?if yes then how to release these objects?
help me.Thanking you…
All lines are pointer to a memory resource, so no memory leak. You have to release memory when you alloc it, to do that use “autorelease”, it will make your life easier.