2010-08-22 5 views
1

J'utilise ShareKit pour permettre à l'utilisateur de partager son score sur Twitter et Facebook dans mon application iPhone. Cependant, il semble s'écraser peu de temps après le partage sur l'un ou l'autre service. Je reçois un message de la console qui dit:Terminer l'application en raison d'une exception non interceptée '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' 

Comment résoudre ce problème? Merci.

Répondre

3

Définissez un point d'arrêt sur objc_exception_throw, puis créez l'application pour le débogage, exécutez l'application avec des points d'arrêt activés et entraînez à nouveau l'arrêt, puis montez la pile vers le code approprié. Quelque chose à l'intérieur de SHKOAuthView webView: shouldStartLoadWithRequest: navigationType: passe un argument nul à NSString rangeOfString. Lorsque vous savez ce qui se passe, il peut être évident que le problème est - à défaut de mettre à jour votre question avec le code approprié et toute information supplémentaire que vous avez déterminée.

Questions connexes