开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜