objective c - Passing NSIndexPath to New View? -
i having real troubles passing nsindexpath new view. how app works:
i have uibarbuttonitem in nab br, tap , popover view, shows bunch of stuff. need nsindexpath main view, popover view.
i have property nsindexpath in popover view class , popover transition connected in storyboard.
then have code pass index path across views:
-(void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { if ([segue.identifier isequaltostring:@"statspopover"]) { statsviewcontroller *statsvc = [segue destinationviewcontroller]; statsvc.selectedindex = stageselectiontable.indexpathforselectedrow; } } however, while gets called, index path isn't sent between views. index path on popover default, 0,0 row , section.
hope can help, thanks.
you know debugging/logging method running, if statement triggered, , stageselectiontable.indexpathforselectedrow has value expect.
doing kind of diagnosis puts on right path solving issue. keep @ -- if test other things nslog or debugger should able find problem.
do know
statsvcnon-nil? if it'snil, message setselectedindexnothing.is
statsvcclass expect? if, say, (table?) view in popover embedded in navigation controller,segue.destinationviewcontrollerpoint nav controller, , you'll need child view controllers array find 1 you're looking for.is whatever accessor method
statsviewcontrollerclass usingselectedindexproperty working right? (this shouldn't problem if it's synthesized accessor strong/retain property.)in
statsviewcontrollerclass, trying workselectedindexbefore gets set? setting property inprepareforsegue:sender:, using inviewdidloadshould work fine, using inawakefromnibmight not, , using ininit...method won't.
Comments
Post a Comment