2010-08-22 88 views
1

我正在使用ShareKit允許用戶在我的iPhone應用程序中的Twitter和Facebook上分享他們的分數。但是,在分享任一服務後,它似乎很快就會崩潰。我收到一條控制檯消息:終止應用程序由於未捕獲的異常'NSInvalidArgumentException'

*** 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' 

我該如何解決這個問題?謝謝。

回答

3

在objc_exception_throw上設置斷點,然後構建調試應用程序,運行帶有斷點的應用程序並再次導致崩潰,然後將堆棧上傳到相關代碼。

SHKOAuthView內的東西webView:shouldStartLoadWithRequest:導航類型:將一個零參數傳遞給NSString rangeOfString。當你知道什麼是通過零時,很明顯問題是什麼 - 如果沒有更新你的問題,用相關的代碼和任何你已經確定的額外信息。

相關問題