ios - Push View Controller From AppDelegate and Tab Bar -
my app setup tab bar controller rootviewcontroller
, , each tab has navigationcontroller
in it. when actions performed, want app force viewcontroller
onto screen. flow of when app starts, or opens background, checks stored nsdate , compares current date. if right status met, shows uialertview
. if button named "push" selected, runs code force new view. reason need ran appdelegate
, there no guarantee tab may open if app beingness used in background. since every tab contains navigationcontroller
, thought run appdelegate:
- (void)alertview:(uialertview *)alertview clickedbuttonatindex:(nsinteger)buttonindex { if (alertview.tag == 100) { if (buttonindex == 0) { //cancel nslog(@"cancel"); } if (buttonindex == 1) { nslog(@"ok"); [self.tabbarcontroller.selectedviewcontroller pushviewcontroller:self.newview animated:yes]; } } }
i warning message says uiviewcontroller may not respond -pushviewcontroller:animated
. suggestions else do?
the homecoming type selectedviewcontroller uiviewcontroller, need tell compiler it's navigation controller. cast,
[(uinavigationcontroller *)self.tabbarcontroller.selectedviewcontroller pushviewcontroller:self.newview animated:yes];
ios uinavigationcontroller uitabbarcontroller appdelegate pushviewcontroller
No comments:
Post a Comment