AMSlideMenu ios8崩溃

时间:2015-01-09 10:28:41

标签: ios ios8 amslidemenu

这是我的故事板link。我已经实现了AMSlideMenu,因为它是在Documentation中编写的。我只想要正确的菜单幻灯片。

My MainVC.m - segueIdentifierForIndexPathInRightMenu

  - (NSString *)segueIdentifierForIndexPathInRightMenu:(NSIndexPath *)indexPath
{
NSString *identifier = @"";
switch (indexPath.row) {
    case 0:
        identifier = @"firstRow";
        break;
    case 1:
        identifier = @"secondRow";
        break;
}

return identifier;
}

当我从第一个VC推出时 - 我收到此错误 - [UITableViewController setMainVC:]:无法识别的选择器发送到实例0x7af58250(因为xcode6 dsnt让viewcontroller有静态tableview,所以我采取了tableviewcontroller,但我已经用viewcontroller做了,但同样的错误和崩溃)< / p>

[UITableViewController setMainVC:]: unrecognized selector sent to instance 0x7af58250

错误是在AMSlideMenuMainViewController的Setup方法中命中 -

- (void)setup
{
self.view.backgroundColor = [UIColor blackColor];

self.isInitialStart = YES;

self.tapGesture = [[UITapGestureRecognizer alloc] init];
self.panGesture = [[UIPanGestureRecognizer alloc] init];

[self.tapGesture addTarget:self action:@selector(handleTapGesture:)];
[self.panGesture addTarget:self action:@selector(handlePanGesture:)];

self.tapGesture.cancelsTouchesInView = YES;
self.panGesture.cancelsTouchesInView = YES;

self.panGesture.delegate = self;


#ifndef AMSlideMenuWithoutStoryboards    
if ([self primaryMenu] == AMPrimaryMenuLeft)
{
    @try
    {
        [self performSegueWithIdentifier:@"leftMenu" sender:self];

        @try {
            [self performSegueWithIdentifier:@"rightMenu" sender:self];
        }
        @catch (NSException *exception) {

        }
    }
    @catch (NSException *exception)
    {
        [self performSegueWithIdentifier:@"rightMenu" sender:self];
        NSLog(@"WARNING: You setted primaryMenu to left , but you have no segue with identifier 'leftMenu'");
    }
}
else if ([self primaryMenu] == AMPrimaryMenuRight)
{
    @try
    {
        [self performSegueWithIdentifier:@"rightMenu" sender:self];

        @try {
            [self performSegueWithIdentifier:@"leftMenu" sender:self];
        }
        @catch (NSException *exception) {
            [self performSegueWithIdentifier:@"leftMenu" sender:self];
        }
    }
    @catch (NSException *exception)
    {
       //CODE GETTING EXCEPTION , CRASHING HERE!
    }
}

我已经实现了segue名称并将其类设置为“AMSlideMenuRightMenuSegue”,其名称为“rightMenu”,用于AMSlidemenuMainVC - segue CustomClass,然后将其标识为“firstRow”和“secondRow”,将类设置为“AMSlideMenuContentSegue”< / p>

感谢任何帮助

1 个答案:

答案 0 :(得分:0)

正如我在文档中提到的那样

  
      
  1. 对于右侧菜单:      将UITableViewController添加到故事板并将其命名为任何继承自 AMSlideMenuRightTableViewController 的类。
  2.