I try use storyboard with table view that segue to controller view that should show me picture. The problem is that the app crush when I press on any "cell".
this is the problem code:
- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
if([[segue identifier] isEqualToString:@"ShowPhoto"])
{
DetailsViewController *dvc = [segue
destinationViewController];
NSIndexPath *path = [[self tableView] indexPathsForSelectedRows];
Photo *pic = [photosArray objectAtIndex:[path row]];
[dvc setCureentPic: pic];
}
}
the problem is the line with NSIndexPath... I think that the reason is that I try insert array into NSIndex. xcode warning: Incompatible pointer types initializing 'NSIndexPath *__strong' with an expression of type 'NSArray.
the crush message: unrecognized selector sent to instance [__NSArrayI row]. how can I solve the problem?