ios - Calling pushViewController after a presentViewController does not work -


i presenting view controller -

[self.navigationcontroller presentviewcontroller:self.thingcontainerviewcontroller animated:yes completion:nil]; //self.navigationcontroller not nil here 

this shows uitableview. want push vc on navigation stack here. self.navigationcontroller nil @ point. idea how make work?

[self.navigationcontroller pushviewcontroller:othercontainer animated:yes]; //self.navigationcontroller nil @ point 

you need wrap view controller presenting in navigation controller in order able use push , pop methods.

so first step:

uinavigationcontroller *navigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:self.thingcontainerviewcontroller]; 

then:

[self.navigationcontroller presentviewcontroller:navigationcontroller animated:yes completion:nil]; 

if that, code work.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -