iphone - Selecting Tabbar item in iOS -
my app has #hashtags can selected.
we have 3 tabs in our tabbar, mainvc, profilevc , tagvc. tagdetailvc typically accessed via tagvc.
when user selects tag, directed tagdetailviewcontroller.
edit hooked tabbarcontroller on storyboard.
right have this:
tagdetailviewcontroller *dest = [[tagdetailviewcontroller alloc] init]; uinavigationcontroller *nav = [self.tabbarcontroller.viewcontrollers objectatindex:2]; [nav pushviewcontroller:dest animated:yes]; however, seeing right tagvc. placed log statement in viewdidload in tagdetailvc , did not show.
for record, how story board organized:
tabbarcontroller -> navigationvc -> mainvc ... -> navigationvc -> profilevc ... -> navigationvc -> tagvc -> tagdetailvc i interested have tabbar select tagvc , push tagdetailvc onto navigationcontroller of tagvc. behavior expecting when user presses tag is: 1. tab selected @ tagvc 2. tagdetailvc pushed onto navigationvc of tagvc.
what doing wrong?
you can use below method uitabbarcontroller:
[tabbarcontroller setselectedindex:2]; according understanding be: navigationvc -> tagvc
now use nsnotification, , push view controller tagdetailvc.
hope might achieve requirement.
Comments
Post a Comment