【发布时间】:2015-10-27 15:20:47
【问题描述】:
我的第一页上有一个滑出式导航面板(菜单)和另一个“菜单”。
滑出菜单:
- 索引
- 第 1 页
- 第 2 页
- 第 3 页
- 第 4 页
在索引上:
- 第 1 页
- 第 2 页
- 第 3 页
- 第 4 页
因此用户可以从索引或通过滑动(或点击图标菜单)访问页面以获取菜单。
但我有一个错误:我从索引转到第 1 页,我点击图标菜单以滑出菜单 我点击索引,我再次从索引转到第 1 页,如果我再次点击这里在图标菜单上,我收到错误:SIGBRT (类似的)
我做了一些断点:
在这条线上:self.delegate?.pushViewControllerInStack!(UIStoryboard.nosOffresViewController()!)
还有一个函数pushViewControllerInStack
当我进行操作时,我的应用读取了这一行 self.delegate?.pushViewControllerInStack!(UIStoryboard.nosOffresViewController()!) 但它没有进入函数。
所以我对这个函数的看法是lost the access,但我不知道为什么以及如何解决这个问题。
代码很多,你可以在这里找到一个git仓库:https://github.com/Vkt0r/SlideOutSideBarTest
错误:
2015-10-28 09:00:33.038 Solutis[477:5075] -[Solutis.NosOffresViewController menuNosOffresTapped:]: unrecognized selector sent to instance 0x7ff5caf464e0
2015-10-28 09:00:33.045 Solutis[477:5075] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Solutis.NosOffresViewController menuNosOffresTapped:]: unrecognized selector sent to instance 0x7ff5caf464e0'
*** First throw call stack:
(
0 CoreFoundation 0x000000010f3b1f65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000111268deb objc_exception_throw + 48
2 CoreFoundation 0x000000010f3ba58d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010f307f7a ___forwarding___ + 970
4 CoreFoundation 0x000000010f307b28 _CF_forwarding_prep_0 + 120
5 UIKit 0x000000010fdf31fa -[UIApplication sendAction:to:from:forEvent:] + 92
6 UIKit 0x00000001101d5247 -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 152
7 UIKit 0x000000010fdf31fa -[UIApplication sendAction:to:from:forEvent:] + 92
8 UIKit 0x000000010ff57504 -[UIControl sendAction:to:forEvent:] + 67
9 UIKit 0x000000010ff577d0 -[UIControl _sendActionsForEvents:withEvent:] + 311
10 UIKit 0x000000010ff5794b -[UIControl _sendActionsForEvents:withEvent:] + 690
11 UIKit 0x000000010ff56906 -[UIControl touchesEnded:withEvent:] + 601
12 UIKit 0x000000010fe5daa3 -[UIWindow _sendTouchesForEvent:] + 835
13 UIKit 0x000000010fe5e691 -[UIWindow sendEvent:] + 865
14 UIKit 0x000000010fe10752 -[UIApplication sendEvent:] + 263
15 UIKit 0x000000010fdebfcc _UIApplicationHandleEventQueue + 6693
16 CoreFoundation 0x000000010f2de0a1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
17 CoreFoundation 0x000000010f2d3fcc __CFRunLoopDoSources0 + 556
18 CoreFoundation 0x000000010f2d3483 __CFRunLoopRun + 867
19 CoreFoundation 0x000000010f2d2e98 CFRunLoopRunSpecific + 488
20 GraphicsServices 0x000000011485bad2 GSEventRunModal + 161
21 UIKit 0x000000010fdf1676 UIApplicationMain + 171
22 Solutis 0x000000010f1b892d main + 109
23 libdyld.dylib 0x0000000111d8092d start + 1
24 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
【问题讨论】:
-
你真的应该发布整个错误。 “SIGBRT(类似的东西)”不会帮助任何人解决您的问题。此外,不太可能有人会访问您的 github 存储库并查看您的所有代码并尝试找出错误。我会发布你调用这些操作的代码块(不仅仅是上面的一行)。
-
当你得到 SIGABRT 时,Xcode 应该显示调试导航器(在 Xcode 窗口的左侧)。选择堆栈跟踪的所有行,复制它们,然后将它们粘贴到您的问题中。
-
@AndrewRobinson 我刚刚发布了错误代码,我认为它没有用,因为我会发布我的应用程序的 80%
-
@robmayoff 我刚刚发布了错误代码
标签: ios swift function protocols