这是完全奇怪的行为!我只有两个视图控制器,比如V1,V2。我试图使用performSegueWithIdentifier
从V1推送V2并且它会抛出此错误
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber pointSize]: unrecognized selector sent to instance 0xb0000000000000e5'
我已经分配了segue标识符。我已经交叉检查了segue的名字,它看起来完全没有空格等。
我尝试使用带有故事板ID的presentViewController
方法呈现V2并且它运行良好,但是当我推动它时却没有。
我测试了另一个具有相同segue标识符的空视图控制器V3(当然,我删除了V2的标识符),并且它正在工作。所以问题是,它只能用V2抛出错误。
修改
完成调用堆栈:
2016-07-27 11:18:24.018 Sample[13254:123408] -[__NSCFNumber pointSize]: unrecognized selector sent to instance 0xb0000000000000e5
2016-07-27 11:18:24.033 Sample[13254:123408] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber pointSize]: unrecognized selector sent to instance 0xb0000000000000e5'
*** First throw call stack:
(
0 CoreFoundation 0x0000000106e5dd85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001068d1deb objc_exception_throw + 48
2 CoreFoundation 0x0000000106e66d3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000106daccfa ___forwarding___ + 970
4 CoreFoundation 0x0000000106dac8a8 _CF_forwarding_prep_0 + 120
5 UIKit 0x0000000104f33023 -[UINavigationBar _defaultTitleFontFittingHeight:withScaleAdjustment:] + 201
6 UIKit 0x0000000104f332ae -[UINavigationBar _defaultTitleFontWithScaleAdjustment:] + 99
7 UIKit 0x0000000104f5e443 -[UINavigationItemView _defaultFont] + 125
8 UIKit 0x0000000104f5e315 -[UINavigationItemView initWithNavigationItem:] + 338
9 UIKit 0x0000000104f2cc89 -[UINavigationItem _defaultTitleView] + 125
10 UIKit 0x0000000104f2cd2b -[UINavigationItem _titleView] + 125
11 UIKit 0x0000000104f4e5d8 -[UINavigationBar _removeItemsFromSuperview:] + 124
12 UIKit 0x0000000104f36718 -[UINavigationBar _setItems:transition:reset:resetOwningRelationship:] + 986
13 UIKit 0x00000001050175f0 -[UINavigationController _setNavigationBarHidden:edge:duration:] + 258
14 UIKit 0x0000000105016f3f -[UINavigationController _setNavigationBarHidden:edgeIfNotNavigating:duration:] + 607
15 UIKit 0x000000010501587c -[UINavigationController setNavigationBarHidden:animated:] + 142
16 Sample 0x0000000102df6783 _TFC10Sample21TPLoginViewController17viewWillDisappearfSbT_ + 195
17 Sample 0x0000000102df67d1 _TToFC10Sample21TPLoginViewController17viewWillDisappearfSbT_ + 49
18 UIKit 0x0000000104fe33aa -[UIViewController _setViewAppearState:isAnimating:] + 947
19 UIKit 0x0000000104fe3ac2 -[UIViewController __viewWillDisappear:] + 93
20 UIKit 0x0000000105013735 -[UINavigationController _startCustomTransition:] + 1176
21 UIKit 0x0000000105023b9b -[UINavigationController _startDeferredTransitionIfNeeded:] + 712
22 UIKit 0x0000000105024d0b -[UINavigationController __viewWillLayoutSubviews] + 57
23 UIKit 0x00000001051d3503 -[UILayoutContainerView layoutSubviews] + 248
24 UIKit 0x0000000104efd980 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 703
25 QuartzCore 0x00000001049e0c00 -[CALayer layoutSublayers] + 146
26 QuartzCore 0x00000001049d508e _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
27 QuartzCore 0x00000001049d4f0c _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
28 QuartzCore 0x00000001049c93c9 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
29 QuartzCore 0x00000001049f7086 _ZN2CA11Transaction6commitEv + 486
30 UIKit 0x0000000104e3d72e _UIApplicationHandleEventQueue + 7135
31 CoreFoundation 0x0000000106d83301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
32 CoreFoundation 0x0000000106d7922c __CFRunLoopDoSources0 + 556
33 CoreFoundation 0x0000000106d786e3 __CFRunLoopRun + 867
34 CoreFoundation 0x0000000106d780f8 CFRunLoopRunSpecific + 488
35 GraphicsServices 0x000000010a9f4ad2 GSEventRunModal + 161
36 UIKit 0x0000000104e42f09 UIApplicationMain + 171
37 Sample 0x0000000102f037f2 main + 114
38 libdyld.dylib 0x00000001081e692d start + 1
39 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException