简体   繁体   English

由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序

[英]Terminating app due to uncaught exception 'NSInvalidArgumentException'

I am using ShareKit to allow the user to share their score on Twitter and Facebook in my iPhone app. 我正在使用ShareKit允许用户在我的iPhone应用程序中在Twitter和Facebook上分享他们的分数。 However, it seems to crash shortly after sharing on either service. 但是,在共享这两种服务后不久,它似乎崩溃了。 I get an console message which says: 我收到一条控制台消息,内容为:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFString rangeOfString:options:range:locale:]: nil argument'
*** Call stack at first throw:
(
 0   CoreFoundation                      0x026d6919 __exceptionPreprocess + 185
 1   libobjc.A.dylib                     0x028245de objc_exception_throw + 47
 2   CoreFoundation                      0x0268f078 +[NSException raise:format:arguments:] + 136
 3   CoreFoundation                      0x0268efea +[NSException raise:format:] + 58
 4   Foundation                          0x0008f97b -[NSString rangeOfString:options:range:locale:] + 424
 5   Foundation                          0x0009de16 -[NSString rangeOfString:] + 104
 6   iPhone Typer                        0x00030220 -[SHKOAuthView webView:shouldStartLoadWithRequest:navigationType:] + 151
 7   UIKit                               0x004bb456 -[UIWebView webView:decidePolicyForNavigationAction:request:frame:decisionListener:] + 458
 8   CoreFoundation                      0x0264742d __invoking___ + 29
 9   CoreFoundation                      0x02647301 -[NSInvocation invoke] + 145
 10  WebCore                             0x030940f0 _ZL20HandleDelegateSourcePv + 64
 11  CoreFoundation                      0x026b7d7f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
 12  CoreFoundation                      0x026162cb __CFRunLoopDoSources0 + 571
 13  CoreFoundation                      0x026157c6 __CFRunLoopRun + 470
 14  CoreFoundation                      0x02615280 CFRunLoopRunSpecific + 208
 15  CoreFoundation                      0x026151a1 CFRunLoopRunInMode + 97
 16  GraphicsServices                    0x02e5e2c8 GSEventRunModal + 217
 17  GraphicsServices                    0x02e5e38d GSEventRun + 115
 18  UIKit                               0x00339b58 UIApplicationMain + 1160
 19  iPhone Typer                        0x00002894 main + 102
 20  iPhone Typer                        0x00002825 start + 53
)
terminate called after throwing an instance of 'NSException'

How would I fix this? 我该如何解决? Thanks. 谢谢。

Set a breakpoint on objc_exception_throw, then build the app for debug, run the app with breakpoints on and cause the crash again, then go up the stack to the relevant code. 在objc_exception_throw上设置一个断点,然后构建用于调试的应用程序,运行具有断点的应用程序,并再次导致崩溃,然后将堆栈移至相关代码。

Something inside SHKOAuthView webView:shouldStartLoadWithRequest:navigationType: is passing a nil argument to NSString rangeOfString. SHKOAuthView内部的某些内容webView:shouldStartLoadWithRequest:navigationType:正在将nil参数传递给NSString rangeOfString。 When you know what is passing the nil, it may be obvious what the problem is - failing that update your question with the relevant code and any extra information you've determined. 当您知道传递nil的内容时,问题可能很明显-未能通过相关代码和您确定的任何其他信息来更新您的问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 由于未捕获的异常'NSInvalidArgumentException而终止应用程序 - Terminating app due to uncaught exception 'NSInvalidArgumentException 由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序 - Terminating app due to uncaught exception 'NSInvalidArgumentException' 由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序, - Terminating app due to uncaught exception 'NSInvalidArgumentException', (由于未捕获的异常'NSInvalidArgumentException而终止应用程序) - (Terminating app due to uncaught exception 'NSInvalidArgumentException) iOS应用程序异常-由于未捕获的异常'NSInvalidArgumentException'而终止应用程序 - iOS App Exception - Terminating app due to uncaught exception 'NSInvalidArgumentException' 由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序,原因:“-[NSDecimalNumber objectAtIndex:] - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSDecimalNumber objectAtIndex:] iPhone上的stringByTrimmingCharactersInSet错误“由于未捕获的异常'NSInvalidArgumentException'而终止应用程序” - “Terminating app due to uncaught exception 'NSInvalidArgumentException'” error with stringByTrimmingCharactersInSet on iPhone 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[__NSCFString isDescendantOfView:]: - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString isDescendantOfView:]: 终止应用程序未捕获的异常“NSInvalidArgumentException” - Terminating app uncaught exception 'NSInvalidArgumentException' 在iPhone编程中由于未捕获的异常'NSInvalidArgumentException'终止了应用程序 - Terminating app due to uncaught exception 'NSInvalidArgumentException', in iPhone programming
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM