ios - 没有 Storyboard Receiver的AMSlideMenu的问题没有标识符'rightMenu'的提示

标签 ios objective-c xcode amslidemenu

这可能是以前发布的,并且相信我我们尝试过搜索并尝试了解决方案,但是它无助于解决我们的问题(我将在StackOverflow上列出我们在这里找到的内容)。

  • 我们在Xcode 9中确实有一个示例项目,并使用了ObjectiveC。由XIB组成(我们不使用情节提要,所以请不要回答与情节提要或Swift相关的问题)。使用PODS
  • 安装了AMSlideMenu


  • 我们的项目结构如下:


  • AppDelegate将打开vcMain,然后将一个按钮启动vcClientMain。 vcClientMain是一个AMSlideMenuMainViewController,应具有左右滑动菜单。

    AppDelegate:
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
        self.window.backgroundColor = [UIColor whiteColor];
    
        vcMain *mainView = [[vcMain alloc] initWithNibName:@"vcMain" bundle:nil];
        self.window.rootViewController = mainView;
        [self.window makeKeyAndVisible];
    
    
        return YES;
    }
    

    vc单击了主要客户端按钮:
    - (IBAction)btnClientClicked:(id)sender {
        vcClientMain *mainView = [[vcClientMain alloc] initWithNibName:@"vcClientMain" bundle:nil];
    
        [self presentViewController:mainView animated:true completion:nil];
    }
    
  • prefix.pch文件包含下面的代码,下面是我们从AMSSlideMenu的notstoryboad样本中复制的代码(包括在实际项目和pods项目中)
    #import <Availability.h>
    
    #ifndef __IPHONE_5_0
    #warning "This project uses features only available in iOS SDK 5.0 and             later."
    #endif
    
    #define SYSTEM_VERSION_EQUAL_TO(v)                  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
    #define SYSTEM_VERSION_GREATER_THAN(v)              ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
    #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
    #define SYSTEM_VERSION_LESS_THAN(v)                 ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
    #define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v)     ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
    
    #define AMSlideMenuWithoutStoryboards
    
    #ifdef __OBJC__
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>
    #endif
    
  • 单击“客户端”按钮时,我们将收到此错误。

  • 2018-01-14 03:44:17.102821 + 0800 Travellogger [5275:1112453] ***由于未捕获的异常'NSInvalidArgumentException'终止了应用程序,原因:'Receiver()与标识符'rightMenu'没有关联
    ***首先抛出调用堆栈:
    (
    0 CoreFoundation 0x00000001064a312b __exceptionPreprocess + 171
    1 libobjc.A.dylib 0x000000010a957f41 objc_exception_throw + 48
    2 UIKit 0x000000010822e3d0-[UIViewController shouldPerformSegueWithIdentifier:sender:] + 0
    3 Travellogger 0x00000001060a36f7-[AMSlideMenuMainViewController设置] + 1063
    4 Travellogger 0x00000001060a09a3-[AMSlideMenuMainViewController viewDidLoad] + 387
    5 Travellogger 0x000000010609e7d3-[vcClientMain viewDidLoad] + 275
    6 UIKit 0x000000010822b46c-[UIViewController loadViewIfRequired] + 1235
    7 UIKit 0x000000010822b8b9-[UIViewController视图] + 27
    8 UIKit 0x0000000108cc4441-[_ UIFullscreenPresentationController _setPresentedViewController:] + 89
    9 UIKit 0x00000001081f82a3-[UIPresentationController initWithPresentedViewController:presentingViewController:] + 133
    10 UIKit 0x000000010823eb67-[UIViewController _presentViewController:withAnimationController:completion:] + 3808
    11 UIKit 0x00000001082419a9 __63- [UIViewController _presentViewController:animated:completion:] _ block_invoke + 99
    12 UIKit 0x0000000108242079-[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 532
    13 UIKit 0x0000000108241908-[UIViewController _presentViewController:animated:completion:] + 181
    14 UIKit 0x0000000108241c67-[UIViewController presentViewController:animated:completion:] + 159
    15 Travellogger 0x000000010609b8f8-[vcMain btnClientClicked:] + 120
    16 UIKit 0x0000000108084972-[UIApplication sendAction:to:from:forEvent:] + 83
    17 UIKit 0x0000000108203c3c-[UIControl sendAction:to:forEvent:] + 67
    18 UIKit 0x0000000108203f59-[UIControl _sendActionsForEvents:withEvent:] + 450
    19 UIKit 0x0000000108202981-[UIControl touchesBegan:withEvent:] + 282
    20 UIKit 0x00000001080fa562-[UIWindow _sendTouchesForEvent:] + 2130
    21 UIKit 0x00000001080fbf2a-[UIWindow sendEvent:] + 4124
    22 UIKit 0x000000010809f365-[UIApplication sendEvent:] + 352
    23 UIKit 0x00000001089eba1d __dispatchPreprocessedEventFromEventQueue + 2809
    24 UIKit 0x00000001089ee672 __handleEventQueueInternal + 5957
    25 CoreFoundation 0x0000000106446101 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    26 CoreFoundation 0x00000001064e5f71 __CFRunLoopDoSource0 + 81
    27 CoreFoundation 0x000000010642aa19 __CFRunLoopDoSources0 + 185
    28 CoreFoundation 0x0000000106429fff __CFRunLoopRun + 1279
    29 CoreFoundation 0x0000000106429889 CFRunLoopRunSpecific + 409
    30图形服务0x000000010dfee9c6 GSEventRunModal + 62
    31 UIKit 0x00000001080835d6 UIApplicationMain + 159
    32 Travellogger 0x000000010609e69f主+ 111
    33 libdyld.dylib 0x000000010b721d81开始+ 1
    )
    libc ++ abi.dylib:以NSException类型的未捕获异常终止
  • 以下是我们在Stackoverflow上研究的一些内容,但不幸的是没有做这些工作:

  • iOS AMSlideMenu Receiver () has no segue with identifier 'rightMenu''

    AMSlideMenu crash: Receiver () has no segue with identifier 'rightMenu'
  • Youtube Video也不起作用
  • 最佳答案

    这是一个非常易于集成且平滑的幻灯片菜单

    https://github.com/beingbarath/BMSlideMenu

    enter image description here

    集成了SWRevealViewController。希望这可以帮助 :)

    关于ios - 没有 Storyboard Receiver的AMSlideMenu的问题没有标识符'rightMenu'的提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48246989/

    相关文章:

    iphone - iOS 照片库 - flickr

    ios - (Apple) GameplayKit State Machine implementation with SKScene

    ios - 我想从 AppDelegate(在 Objective C 中)调用用 Swift 编写的类函数。我究竟做错了什么?

    c - 我如何让 Xcode 考虑我定义的值?

    ios - iOS Dev- Hook 到应用程序音频输出

    ios - "Parse Issue Expected ' ] '"

    iphone - 如何在横向模式下转换 Navigation Bar 和 Navigation Controller

    ios - 无法从核心图、RealTimePlot 中删除或隐藏轴

    ios - 无法安装 pod( fatal error : unable to access 'https://github.com/CocoaPods/Specs.git/' )

    ios - 我为 Portrait/PortraitUpsideDown 应用程序使用哪种尺寸等级