iphone - self.navigationcontroller pushs viewcontroller without navigation item -


i running out of ideas problem. have uitabbarcontroller , 2 tabs navigationcontrollers in there.

i have set of viewcontrollers navigation. these viewcontrollers used in same order on both tabs/navigationcontrollers different data.

the previous-to-last viewcontroller making nsurlconnection, , in connectiondidfinishloading: last viewcontroller should shown, using code:

[self.navigationcontroller poptorootviewcontrolleranimated:no]; [self.navigationcontroller pushviewcontroller:lastviewcontroller animated:yes]; 

this pop root viewcontroller, never push last viewcontroller. (sidenote: working quite time, stopped working when using second tabbar's navigationcontroller).

furthermore, if comment out first line:

//[self.navigationcontroller poptorootviewcontrolleranimated:no]; [self.navigationcontroller pushviewcontroller:lastviewcontroller animated:yes]; 

the last viewcontroller shown, misses button in navigation bar, , it's not disabled or something. suspect somehow self.navigationcontroller returning wrong navigationcontroller. it's if navigationcontroller has "forgotten" viewcontroller stack.

  1. could related connectiondidfinishloading: being different thread?
  2. has suggestion how "the navigationcontroller in tab" in different way?

i triple checked code , down, couldn't find anything. other viewcontrollers before 1 being pushed , popped without problems.

thanks on this, feel stuck!

what said gave me idea. thinking self.navigationcontroller may set nil after it's pushed, therefore, it's not set when you're pushing new view controller. doing fixed problem! :)

uinavigationcontroller *navigationcontroller = self.navigationcontroller; [navigationcontroller poptorootviewcontrolleranimated:no]; [navigationcontroller pushviewcontroller:lastviewcontroller animated:yes]; 

Comments