2014-09-02 31 views
0

我知道關於此問題已有question,但提供的答案並未解決我的問題。AMSlideMenu崩潰:Receiver(<MenuViewController:0x10db0da10>)沒有帶標識符的segue'rightMenu'

首先,我有3個三段指向3個不同的視圖控制器,來自AMSlideMenuLeftTableViewController類。我創建的第一個segue和視圖控制器是作爲第一個視圖(顯示應用程序加載時顯示的視圖)顯示的視圖。

但是,由於我刪除了第一個視圖,我的應用程序在打開後立即崩潰。

這是崩潰日誌:

2014-09-02 17:17:56.200 App[3174:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<MenuViewController>: 0x10db0da10>) has no segue with identifier 'rightMenu'' 
*** First throw call stack: 
(
    0 CoreFoundation      0x0000000100433495 __exceptionPreprocess + 165 
    1 libobjc.A.dylib      0x00000001030f499e objc_exception_throw + 43 
2 UIKit        0x0000000101d99515 -[UIViewController shouldPerformSegueWithIdentifier:sender:] + 0 
3 App      0x000000010002d67f -[AMSlideMenuMainViewController setup] + 1071 
4 App      0x000000010002aae1 -[AMSlideMenuMainViewController viewDidLoad] + 353 
5 App      0x00000001000915e6 -[MenuViewController viewDidLoad] + 54 
6 UIKit        0x0000000101d9759e -[UIViewController loadViewIfRequired] + 562 
7 UIKit        0x0000000101d97777 -[UIViewController view] + 29 
8 UIKit        0x00000001020a22e2 -[UIClientRotationContext initWithClient:toOrientation:duration:andWindow:] + 390 
9 UIKit        0x0000000101cddffa -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 1109 
10 UIKit        0x0000000101cddb9f -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 36 
11 UIKit        0x0000000101cddaef -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 101 
12 UIKit        0x0000000101cdcdfe -[UIWindow _updateToInterfaceOrientation:duration:force:] + 377 
13 UIKit        0x0000000101d9b70a -[UIViewController _tryBecomeRootViewControllerInWindow:] + 147 
14 UIKit        0x0000000101cd7b1b -[UIWindow addRootViewControllerViewIfPossible] + 490 
15 UIKit        0x0000000101cd7c70 -[UIWindow _setHidden:forced:] + 282 
16 UIKit        0x0000000101ce0ffa -[UIWindow makeKeyAndVisible] + 51 
17 UIKit        0x0000000101c9cc98 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1788 
18 UIKit        0x0000000101ca0a0c -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 660 
19 UIKit        0x0000000101cb1d4c -[UIApplication handleEvent:withNewEvent:] + 3189 
20 UIKit        0x0000000101cb2216 -[UIApplication sendEvent:] + 79 
21 UIKit        0x0000000101ca2086 _UIApplicationHandleEvent + 578 
22 GraphicsServices     0x0000000104eff71a _PurpleEventCallback + 762 
23 GraphicsServices     0x0000000104eff1e1 PurpleEventCallback + 35 
24 CoreFoundation      0x00000001003b5679 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41 
25 CoreFoundation      0x00000001003b544e __CFRunLoopDoSource1 + 478 
26 CoreFoundation      0x00000001003de903 __CFRunLoopRun + 1939 
27 CoreFoundation      0x00000001003ddd83 CFRunLoopRunSpecific + 467 
28 UIKit        0x0000000101ca02e1 -[UIApplication _run] + 609 
29 UIKit        0x0000000101ca1e33 UIApplicationMain + 1010 
30 App      0x0000000100076503 main + 115 
31 libdyld.dylib      0x0000000103ddd5fd start + 1 
) 
libc++abi.dylib: terminating with uncaught exception of type NSException 
(lldb) 

我認爲這個問題是應用程序試圖顯示我刪除作爲主視圖的看法,但它是不存在的。事實是,我沒有找到我刪除的舊觀點的任何參考。

+0

你的'AMSlideMenuMainViewController.setup()'用'rootMenu'標識符調用了segue。 – NRitH 2014-09-02 15:37:14

+0

@NRitH - 什麼意思?我從來沒有將''rootMenu''設置爲標識符。 – alvarolopez 2014-09-02 15:50:14

+0

我的意思是'rightMenu'。 – NRitH 2014-09-02 19:14:31

回答

2

如果AMSlideMenu抓到試圖創建LeftMenu異常時,就會試圖創建RightMenu(我不明白爲什麼,但就是如此)。

在我的情況下,左側菜單firstSegue指向'錯誤的視圖',因爲它是一個簡單的視圖控制器,而不是導航控制器。我將視圖控制器更改爲導航控制器(指向我的原始視圖控制器),並修復了它。

0

將AMSlideMenuWithoutStoryboard-Prefix.pch文件設置複製到項目的PCH文件中。