没有故事板的AMSlideMenu的问题接收器没有带标识符的右侧' rightMenu'

时间:2018-01-14 05:38:48

标签: ios objective-c xcode amslidemenu

之前可能已发布此信息并相信我们已尝试搜索并尝试了解决方案,但它并没有帮助解决我们的问题(我将列出我们在StackOverflow上找到的内容)。

  1. 我们在Xcode 9中有一个示例项目并使用Objective C.由XIB组成(我们不使用故事板,所以请不要回答与故事板或swift相关的问题)。 AMSlideMenu使用PODS
  2. 安装

    xcode version

    1. 我们的项目结构如下:
    2. XCode Project Structure

      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;
      }
      

      点击了vcMain客户端按钮:

      - (IBAction)btnClientClicked:(id)sender {
          vcClientMain *mainView = [[vcClientMain alloc] initWithNibName:@"vcClientMain" bundle:nil];
      
          [self presentViewController:mainView animated:true completion:nil];
      }
      
      1. prefix.pch文件包含我们从AMSSlideMenu的非storboad sampl复制的代码(包含在实际项目和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
        
      2. 单击“客户端”按钮时,我们收到此错误

      3.     2018-01-14 03:44:17.102821+0800 Travellogger[5275:1112453] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver () has no segue with identifier 'rightMenu''
        *** First throw call stack:
        (
            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 setup] + 1063
            4   Travellogger                        0x00000001060a09a3 -[AMSlideMenuMainViewController viewDidLoad] + 387
            5   Travellogger                        0x000000010609e7d3 -[vcClientMain viewDidLoad] + 275
            6   UIKit                               0x000000010822b46c -[UIViewController loadViewIfRequired] + 1235
            7   UIKit                               0x000000010822b8b9 -[UIViewController view] + 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  GraphicsServices                    0x000000010dfee9c6 GSEventRunModal + 62
            31  UIKit                               0x00000001080835d6 UIApplicationMain + 159
            32  Travellogger                        0x000000010609e69f main + 111
            33  libdyld.dylib                       0x000000010b721d81 start + 1
        )
        libc++abi.dylib: terminating with uncaught exception of type NSException
        
        1. 以下是我们在Stackoverflow上研究的一些内容,但遗憾的是没有完成这项工作:
        2. iOS AMSlideMenu Receiver () has no segue with identifier 'rightMenu''

          AMSlideMenu crash: Receiver () has no segue with identifier 'rightMenu'

          1. Youtube Video无效

1 个答案:

答案 0 :(得分:0)

这是一个非常容易整合和流畅的幻灯片菜单

https://github.com/beingbarath/BMSlideMenu

enter image description here

SWRevealViewController的集成。希望这会有所帮助:)