如何从幻灯片菜单单元格推送到新的viewcontroller

时间:2015-07-07 07:35:34

标签: ios swrevealviewcontroller

我有一个滑出表视图菜单,并使用模态segue连接第二个视图控制器。我正在使用导航栏。

FirstViewController:

- (void) prepareForSegue: (UIStoryboardSegue *) segue sender: (id) sender {

    NSIndexPath *indexPath = [self.filterTableView indexPathForSelectedRow];
     UINavigationController *navController = (UINavigationController*)[segue destinationViewController];
        // Set the photo if it navigates to the PhotoView
    if ([segue.identifier isEqualToString:@"showCatView"]) {

        catView= [navController topViewController];

        NSString *catid= [[myObject objectAtIndex:indexPath.row] valueForKey:@"catid"];
        catView.catid = catid;
    }

    if ( [segue isKindOfClass: [SWRevealViewControllerSegue class]] ) {
        SWRevealViewControllerSegue *swSegue = (SWRevealViewControllerSegue*) segue;

        swSegue.performBlock= ^(SWRevealViewControllerSegue* rvc_segue, UIViewController* svc, UIViewController* dvc) {

            UINavigationController* navController = (UINavigationController*)self.revealViewController.frontViewController;
            [navController setViewControllers: @[dvc] animated: NO ];
            [self.revealViewController setFrontViewPosition: FrontViewPositionLeft animated: YES];
        };

    }

SecondViewController

- (IBAction)btnBack:(id)sender {
    UIViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"ViewController"];
    [self presentViewController:vc animated:YES completion:nil];

}

我收到错误

  

原因:'*** - [__ NSArrayM insertObject:atIndex:]:对象不能为零'

0 个答案:

没有答案