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 statsvc non-nil? if it's nil, message set selectedindex nothing.

  • is statsvc class expect? if, say, (table?) view in popover embedded in navigation controller, segue.destinationviewcontroller point nav controller, , you'll need child view controllers array find 1 you're looking for.

  • is whatever accessor method statsviewcontroller class using selectedindex property working right? (this shouldn't problem if it's synthesized accessor strong/retain property.)

  • in statsviewcontroller class, trying work selectedindex before gets set? setting property in prepareforsegue:sender: , using in viewdidload should work fine, using in awakefromnib might not, , using in init... method won't.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -