Presentmodalviewcontroller method problem with retain count

Posted by Infinity on Stack Overflow See other posts from Stack Overflow or by Infinity
Published on 2010-04-14T09:58:22Z Indexed on 2010/04/14 10:03 UTC
Read the original article Hit count: 356

Filed under:
|
|
|

Hello guys!

I am trying to present a modal view controller. I have read the documentation, but something is strange. Here's my code:

NSLog(@"rc: %d", [modalViewController retainCount]);
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:modalViewController];
[self presentModalViewController:navigationController animated:YES];
[navigationController release];
NSLog(@"rc: %d", [modalViewController retainCount]);

And on the console, appears:

rc: 2
rc: 24

And I think 24 is very strange... What do you thin? Why is this happening?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about iphone