Is a release needed on a ViewController
When loading the ZZZViewController as shown below
ZZZViewController *zzzvc = [[ZZZViewController 开发者_Python百科alloc] initWithNibName:@"ZZZViewController" bundle:nil];
zzzvc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:zzzvc animated:YES];
do I now do a [zzzvc release]
;
Thanks
Yes, you alloc/init'd it. You are responsible for cleaning it up.
Yes because :
alloc => +1
presentModalViewController => +1
dismiss => -1
total : +1 not 0. => BAD
release => -1
total : 0 => OK
精彩评论