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
Post a Comment