2010-11-05 9 views
0

J'ai rencontré un problème plutôt étrange, mon appli se bloque si j'essaie de lancer [webView loading]!L'application se bloque à [chargement UIWebView] -call

Le BOOL est même déclaré dans les documents, mais il émet une exception lorsqu'il tente d'y accéder.

C'est vraiment gênant, car sans cette BOOL, je ne peux pas travailler ou non wether webView a vraiment fini ... Chargement

(sous iOS 4,1)

EXCEPTION:

2010-11-05 22:14:23.808 MyApp[55671:207] Started Download.. 
2010-11-05 22:14:24.151 MyApp[55671:207] -[UIWebView loading]: unrecognized selector sent to instance 0x764c5a0 
2010-11-05 22:14:24.153 MyApp[55671:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIWebView loading]: unrecognized selector sent to instance 0x764c5a0' 
*** Call stack at first throw: 
(
    0 CoreFoundation      0x02936b99 __exceptionPreprocess + 185 
    1 libobjc.A.dylib      0x02a8640e objc_exception_throw + 47 
    2 CoreFoundation      0x029386ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187 
    3 CoreFoundation      0x028a82b6 ___forwarding___ + 966 
    4 CoreFoundation      0x028a7e72 _CF_forwarding_prep_0 + 50 
    5 MyApp        0x00037aec -[Browser webViewDidFinishLoad:] + 53 
    6 UIKit        0x0893bf29 -[UIWebViewAccessibility(SafeCategory) webView:didFinishLoadForFrame:] + 69 
    7 CoreFoundation      0x028a75cd __invoking___ + 29 
    8 CoreFoundation      0x028a74a1 -[NSInvocation invoke] + 145 
    9 CoreFoundation      0x028d4ba8 -[NSInvocation invokeWithTarget:] + 72 
    10 CoreFoundation      0x028a8354 ___forwarding___ + 1124 
    11 CoreFoundation      0x028a7e72 _CF_forwarding_prep_0 + 50 
    12 CoreFoundation      0x028a75cd __invoking___ + 29 
    13 CoreFoundation      0x028a74a1 -[NSInvocation invoke] + 145 
    14 WebCore        0x03282cb0 _ZL20HandleDelegateSourcePv + 64 
    15 CoreFoundation      0x02917faf __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15 
    16 CoreFoundation      0x0287639b __CFRunLoopDoSources0 + 571 
    17 CoreFoundation      0x02875896 __CFRunLoopRun + 470 
    18 CoreFoundation      0x02875350 CFRunLoopRunSpecific + 208 
    19 CoreFoundation      0x02875271 CFRunLoopRunInMode + 97 
    20 GraphicsServices     0x02ffd00c GSEventRunModal + 217 
    21 GraphicsServices     0x02ffd0d1 GSEventRun + 115 
    22 UIKit        0x00377af2 UIApplicationMain + 1160 
    23 MyApp        0x00002634 main + 102 
    24 MyApp        0x000025c5 start + 53 
) 
terminate called after throwing an instance of 'NSException' 

causé par cette petite ligne:

if ([interwebz loading]){ /**/ } 
+1

Pouvez-vous coller l'exception? – Yuras

+0

Sûr :)  – Emil

Répondre

1

Ah, à droite. Il n'y a pas de méthode de chargement. Il existe une méthode -isLoading. Le nom de la propriété est appelé "chargement". Donc, si vous utilisez la syntaxe de l'appel de méthode, comme vous l'êtes, vous appelleriez [webView isLoading].

Notez que la console dit:

2010-11-05 22: 14: 24,151 MyApp [55671: 207] - [UIWebView chargement]: sélecteur non reconnu envoyé à l'instance 0x764c5a0

+0

Voir la question mise à jour, s'il vous plaît. – Emil

+0

Oh, merci, stupide moi :) – Emil

2

De docs:

@property(nonatomic, readonly, getter=isLoading) BOOL loading 

Utilisez [webView isLoading]