I am trying to pass in IndexPath through a segue though a navigationController, but it crashes on line:
view.selectedAccount = self.selectedAccountRow;
thanks
-(IBAction)changeButtonPressed:(id)sender {
CGPoint buttonPosition = [sender convertPoint:CGPointZero toView:self.accountTableView];
NSIndexPath *indexPath = [self.accountTableView indexPathForRowAtPoint:buttonPosition]
self.indexPath = indexPath;
NSLog(@"%ld",(long)indexPath.row);
}
and
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
[super prepareForSegue:segue sender:sender];
ViewController2 *view = [segue destinationViewController];
view.selectedAccount = self.indexPath;
}
answer here: Set NSString Object, prepareForSegue through UINavigationController