iphone - How can I set navigationController property of subview-viewController? -


i have uiviewcontroller, , has uitableviewcontroller subview.

table view not visible, in sometime visible user's action. (for example, search table view.)

so, 2 new controller has no relation actually, (but uiviewcontroller has uitableviewcontroller member variable), view has parent - subview releation.

in situation, user click cell item in table view, have push new view controller navigation controller.

but parent uiviewcontroller in navigationcontroller, subview uitableviewcontroller not.

so code

[self pushviewcontroller:viewcontroller animated:yes]; 

fails in uitableviewcontroller.

i solved problem passing navigationcontroller instance of parent uiviewcontroller uitableviewcontroller property named parentnavigationcontroller, , called

[self.parentnavigationcontroller pushviewcontroller:viewcontroller animated:yes]; 

instead.

it solution not bad, thinks confused, want know there more clearing solution.

how programming in situation, friends?

i think parent-sub view relation of 2 view controller confused, in first. better if manage 2 views in 1 viewcontroller? if then, view property of uitableviewcontroller can not table view? (and view has table view subview)

thanks support, in advance.

actually concept push view controllers navigation stack of navigation controller. , uiviewcontrollers can present modal view controllers, can not push view controllers. so, sending pushviewcontroller message self(which uiviewcontroller) wrong. can push view controller using [self.navigationcontroller pushviewcontroller:anotherviewcontroller];


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -