Very strange dealloc behavior - did not receive a call

I tested all the dealloc viewControllers methods. And they are all called properly when calling popViewControllerAnimated.

But only one controller dealloc method is not called. I can not understand the problem.

When I clicked on this controller, I wrote the following code correctly:

AController *contr = [AController alloc]initWithNibName:nil bundle:nil];
[self.navigationController pushViewController:contr animated:YES];
[contr release];

and when I return from the controller, I wrote:

[self.navigationController popViewControllerAnimated:YES];

This is a really strange behavior because this code is written on many controllers and works fine.

+5
source share
6 answers

, . , . , ( ) , . , ( , - ), .

+19

dealloc , , .

, , , .

+7

, UIViewController 3 ( ). PushViewCOntroller popViewController , dealloc , .

pushViewCOntroller

[self.navigationController presentModalViewController:copyrightView animated:NO];

[self.navigationController dismissModalViewControllerAnimated:NO];

.

, ; .

+1

autorelease viewcontroller , -

[[AController alloc]initWithNibName:nil bundle:nil]autorelease];
0

, ref . . , , .

0

All Articles