尝试隐藏标签栏项目时出错
- [UITabBarItem setHidden:]:发送到实例的无法识别的选择器
0 CoreFoundation 0x0493cdf6 exceptionPreprocess + 182 1 libobjc.A.dylib 0x03fe4837 objc_exception_throw + 44 2 CoreFoundation
0x04944a75 - [NSObject(NSObject)doesNotRecognizeSelector:] + 277 3
CoreFoundation 0x0488d9c7 ___ forwarding _ + 1047 4 CoreFoundation 0x0488d58e _CF_forwarding_prep_0 + 14 5 SkyDroid-Pro 0x00116037 - [tabBarAppAppDelegate application:didFinishLaunchingWithOptions:] + 279 6 UIKit
0x00a8c47c - [UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 291 7 UIKit 0x00a8d187 - [UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2869 8 UIKit 0x00a906df - [UIApplication _runWithMainScene:transitionContext:completion:] + 1639 9 UIKit 0x00aa9410 84- [UIApplication _handleApplicationActivationWithScene:transitionContext:完成:] _ block_invoke + 59 10 UIKit 0x00a8f2eb - [UIApplication workspaceDidEndTransaction:] + 155 11 FrontBoardServices 0x0525ffee __37- [FBSWorkspace clientEndTransaction:] _ block_invoke_2 + 71 12 FrontBoardServices
0x0525fc34 __40- [FBSWorkspace _performDelegateCallOut:] _ block_invoke + 54 13 FrontBoardServices 0x05271775 __31- [FBSSerialQueue performAsync:] _ block_invoke + 26 14 CoreFoundation 0x048607a0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 16 15 CoreFoundation 0x048560b3 __CFRunLoopDoBlocks + 195 16 CoreFoundation
0x04855f0b __CFRunLoopRun + 2715 17 CoreFoundation
0x048551ab CFRunLoopRunSpecific + 443 18 CoreFoundation
0x04854fdb CFRunLoopRunInMode + 123 19 UIKit
0x00a8ecb0 - [UIApplication _run] + 571 20 UIKit
0x00a92386 UIApplicationMain + 1526 21 SkyDroid-Pro
0x00115efc main + 76 22 libdyld.dylib
0x04320ac9 start + 1
答案 0 :(得分:2)
hidden
及其子类上存在UIView
属性。 UITabBarItem
不是UIView
的子类。它是UIBarItem
的子类,继承自NSObject
。
尝试在setHidden:
的实例上调用选择器UITabBarItem
会导致它崩溃,因为它没有办法处理它。