iphone - Push/Pop View Controller EXC_BAD_ACCESS -
anyone know why if push/pop localsearchviewcontroller, exc_bad_access error after 5 push/pops
if (localsearchviewcontroller == nil) localsearchviewcontroller = [[localsearchviewcontroller alloc] init]; cbaappappdelegate *app = (cbaappappdelegate *) [[uiapplication sharedapplication] delegate]; [app.navbarcontroller.navigationbar sethidden:yes]; [app.navbarcontroller pushviewcontroller: localsearchviewcontroller animated:yes];
i don't know if cause if crash unless have overwritten view controller's init method, should using designated initialiser instead:
- (id)initwithnibname:(nsstring *)nibname bundle:(nsbundle *)nibbundle
and if have method defined in implementation file, make sure calling super on too.
if doesn't solve problem, can try , find code crashing setting breakpoints through method , within localsearchviewcontroller well. on release problem somewhere in code.
[edit add]
here's code initialising view controller should like:
localsearchviewcontroller = [[localsearchviewcontroller alloc] initwithnibname:@"yournibname" bundle:nil];
Comments
Post a Comment