ios - UIViewController released before its view has been closed -


i'm developing ios application latest sdk , using arc.

i show uiviewcontroller:

- (ibaction)showmyobjectsmenu:(id)sender {     myobjectsmenuviewcontroller* myobjectscontroller = [[myobjectsmenuviewcontroller alloc] initwithnibname:@"myobjectsmenuviewcontroller" bundle:nil];      [self.view addsubview:myobjectscontroller.view]; } 

but wrong because myobjectscontroller released @ of method - (ibaction)showmyobjectsmenu:(id)sender.

how can show viewcontroller on right way?

either add controller child view controller (ios 5.0+) or otherwise store in instance variable somewhere. same other variable needs longer storage.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -