ios - Access to a pushed controller from navigationController -


i try set properties pushed viewcontroller (viewcontroller b) previous view in stack of nav controller (viewcontroller a).

however object (header) try set properties nil @ moment set properties. (checked breakpoints)

viewcontrollerb.m

 breapoint 1 -> viewcontrollera * missionvc = (viewcontrollera *) self.navigationcontroller.viewcontrollers[n-2];    breakpoint 2 ->missionvc.header.title = companyname; missionvc.header.subtitle = missionname;  [self.navigationcontroller popviewcontrolleranimated:yes]; 

at breakpoint 1, missionvc has header object correctly initialized, @ breakpoint 2 missionvc.header nil , don't know why.

you creating new object of previous view controller. should pass reference of viewcontroller b , set value of viewcontroller a. either can use delegate pass object.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -