samedi 25 avril 2015

UIViewController Destructor not being called


Currently I have two UIViewControllers called FormA and FormB

Now FormA calls FormB as such (formB property in formA is nonatomic and strong)

self.formB = [[ MediaPlayer alloc] initWithNibName:@"MediaPlayer" bundle:nil ];

[self presentViewController:self.formB animated:TRUE completion:nil];

and when FormB attempts to close it goes back to FormA as such

[ ((FormA*)self.presentingViewController) BackHere];

Now Back in FormA. FormA attempts to close FormB in this way

[self.presentedViewController dismissViewControllerAnimated:TRUE completion:nil];

self.formB = nil;

Doing the above does not call the destructor in FormB which is

-(void)dealloc {

    /* Desructor*/
}

Why si the destructor not being called ?


Aucun commentaire:

Enregistrer un commentaire