0

Hi I am developing one iPhone application. I am triggering segue and inside onprepare segue I am sending data to my next view controller.In storyboard my segue is pointing to navigation controller of my expected view controller and its back segue. So here is my issue :

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if([[segue identifier] isEqualToString:@"mediaDetailSegue1"] || [[segue identifier]             isEqualToString:@"mediaDetailSegue2"])
{
    // this is working properly on below IOS 8 but not on IOS8
    MediaDetailViewController *mediaDetail = [segue destinationViewController];

    // this is working properly on IOS8 but not on below versions.
    MediaDetailViewController *mediaDetail = ([[segue destinationViewController]viewControllers][0]);
    mediaDetail.videoData = [_mediaContentArray objectAtIndex:selectedIndex];
    mediaDetail.isPlayVideo = isPlayVideo;
}
}

So as I mention in above code destination controller is not working properly for both versions.It is giving me following error:

for IOS8
 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UINavigationController setVideoData:]: unrecognized selector sent to instance 0x176aa980'

for below IOS7
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MediaDetailViewController viewControllers]: unrecognized selector sent to instance 0x14de8c00'

I can handle this situation according to versions but I want to know whether I am doing right or wrong.What is the proper way to handle this scenario? Need some help. Thank you.

nilkash
  • 7,408
  • 32
  • 99
  • 176
  • I see the same behaviour when I use the new "Show (e.g. Push)" segues. On iOS7 I get a viewController wrapped in a navigationController, on iOS7 however I get the viewController directly. Really odd. – plu Feb 02 '15 at 18:31
  • ..nilesh,try to solve this – abhimuralidharan Apr 07 '15 at 05:39

0 Answers0