Hi, i have an view based application and when i checked if the dealloc method was workin, i saw that doesnt...debug and debug, then using retainCount, i discover that my viewcontroller retaincount gets crazy on the program start...its easy to reproduce....
just start a new view based application template, and in the didFinishLaunchingWithOptions:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after app launch.
NSLog(@"i1 %i",[viewController retainCount]);
[window addSubview:viewController.view];
NSLog(@"i2 %i",[viewController retainCount]);
[window makeKeyAndVisible];
return YES;
}
i got on the console:
[Session started at 2010-08-07 09:57:34 -0300.]
2010-08-07 09:57:35.132 teste1[20367:207] i1 2
2010-08-07 09:57:35.138 teste1[20367:207] i2 8
is this right?
then when i press the iphone home button to close the app, dealloc methos nevers get called, i believe because viewController's retainCount.... i am right?
This is the apple's view application template...should work ...doesnt it?
Can someone explain me why the initial retaincount is 2????? and the other 8??? the xib file is blank....