我关注" https://segment.com/"在我的iOS源上实现分析用户使用情况。但是,当我使用UIAlertController
来显示带有标题的警报是@""时,我的应用程序崩溃了!我不确切知道为什么。要解决它,我必须设置警报标题为零。这是我的日志:
2016-11-10 17:12:57.185 Lightning Rider Partner[24434:236155] *** Assertion failure in -[SEGAnalytics screen:properties:options:](), /Users/dungdo/Desktop/tcourier-ios/v2_driver/Pods/Analytics/Analytics/Classes/SEGAnalytics.m:323
2016-11-10 17:12:57.192 Lightning Rider Partner[24434:236155] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'screen name () must not be empty.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010c1f134b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00000001120f521e objc_exception_throw + 48
2 CoreFoundation 0x000000010c1f5442 +[NSException raise:format:arguments:] + 98
3 Foundation 0x0000000111cc1d79 -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 166
4 Analytics 0x000000010bc29d37 -[SEGAnalytics screen:properties:options:] + 471
5 Analytics 0x000000010bc3fb7c -[UIViewController(SEGScreen) seg_viewDidAppear:] + 444
6 UIKit 0x000000010e50eb0c -[UIViewController _setViewAppearState:isAnimating:] + 945
7 UIKit 0x000000010e51187a __64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke + 42
8 UIKit 0x000000010e50fb64 -[UIViewController _executeAfterAppearanceBlock] + 86
9 UIKit 0x000000010e374438 _runAfterCACommitDeferredBlocks + 653
10 UIKit 0x000000010e360f6f _cleanUpAfterCAFlushAndRunDeferredBlocks + 566
11 UIKit 0x000000010e3923da _afterCACommitHandler + 176
12 CoreFoundation 0x000000010c195e17 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
13 CoreFoundation 0x000000010c195d87 __CFRunLoopDoObservers + 391
14 CoreFoundation 0x000000010c17ab9e __CFRunLoopRun + 1198
15 CoreFoundation 0x000000010c17a494 CFRunLoopRunSpecific + 420
16 GraphicsServices 0x0000000115145a6f GSEventRunModal + 161
17 UIKit 0x000000010e367964 UIApplicationMain + 159
18 Lightning Rider Partner 0x000000010ad74c3f main + 111
19 libdyld.dylib 0x00000001128a868d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
答案 0 :(得分:1)
我在使用Segment框架时遇到了同样的问题。
我只是在SDK文件中为空屏幕注释Assert语句。请在整个项目中搜索下面的行,并将其评论出来。
NSCAssert1(screenTitle.length> 0,@“屏幕名称(%@)不能为空。”,screenTitle);
你很高兴。
答案 1 :(得分:0)
这似乎是错误Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'screen name () must not be empty.
确保您在创建SEGAnalytics
课程或相关内容时已经设置了