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
Post a Comment