0

这是我的故事板链接。我已经实现了 AMSlideMenu,因为它是在文档中编写的。我只想要右菜单幻灯片。

我的 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:]: unrecognized selector sent to instance 0x7af58250 (As xcode6 dsnt let viewcontroller has static tableview,所以我拿了一个tableviewcontroller,但我用viewcontroller完成了也,但同样的错误和崩溃)

[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”,并将其名称设置为AMSlidemenuMainVC的“rightMenu” - segue CustomClass,然后作为“firstRow”和“secondRow”的进一步标识符,并将类设置为“AMSlideMenuContentSegue”

任何帮助表示赞赏

4

1 回答 1

0

正如我在文档中提到的

  1. 对于右菜单:将 UITableViewController 添加到您的故事板,并将其类命名为从AMSlideMenuRightTableViewController继承的任何类。
于 2015-04-26T08:22:05.577 回答