remove ViewController from memory

Posted by user262325 on Stack Overflow See other posts from Stack Overflow or by user262325
Published on 2010-04-21T06:00:07Z Indexed on 2010/04/21 6:03 UTC
Read the original article Hit count: 376

Filed under:

hello everyone

I hope to load an ViewController and do something then unload it from memory.

if (self.vViewController5.view.superview==nil)
{

    ViewController5 *blueController = 
    [[ViewController5 alloc] initWithNibName:@"View5" bundle:nil];

    self.vViewController5 = blueController;

    [self.vViewController5 setDelegate:self];
    [blueController release];
}

[self presentModalViewController:vViewController5 animated:YES]; 

later, call

[self dismissModalViewControllerAnimated:YES];

but I found that dismissModalViewControllerAnimated does not trigger the event viewDidUnload of Viewcontroller5.

I try function release but it caused program collapse. I also try removeFromSuperView but it does not trigger the event ViewDidUnload neither.

Welcome any comment

Thanks

interdev

© Stack Overflow or respective owner

Related posts about iphone