2016-10-17 1 views
-1

ist: Ich bin auf Objective-C, ich anderer Leute Code suchen und versuchen, es neu zu schreiben, aber ich halte Thread 1-Signal SIGABRT bekommen Error. Ich glaube nicht, dass es um Storyboard geht, weil dieses Projekt es nicht benutzt, fast alles nur durch Programmierung von Code.Ich habe einen Thread 1-Signal SIGABRT Fehler, aber ich glaube nicht, dass über Storyboard

es passieren, wenn ich APP öffnen, geben Sie Account und das Passwort, um sich einzuloggen versuchen, Post und erhalten Daten zurück, kommen die Fehler aus! scheint, als ob ich nichts zurückbekomme oder versage.

i Ziel-Block nicht zu sehen, bevor sie verwenden, aber ich bin immer sicher Problem auf dieser Linie passieren.

if (success) { 
     success(responseObject) 
} 

hoffe jemand kann mir eine Idee geben, dieses Problem zu denken !! Danke vielmals.

+(void)post:(NSString *)URLString parameters:(id)parameters success:(void (^)(id))success failure:(void (^)(NSError *))failure{ 
    AFHTTPSessionManager *session = [AFHTTPSessionManager manager]; 
    [session POST:URLString parameters:parameters progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { 
     if (success) { 
      success(responseObject); 
     } 
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { 
     if (failure) { 
      failure(error); 
     } 
    }]; 
} 

Crash-Log:

2016-10-17 18:49:17.487 chongBa[23417:383815] -canOpenURL: failed for URL: "weixin://app/wx37c8011ed84267db/" - error: "(null)" 2016-10-17 18:49:17.492 chongBa[23417:383815] Reachability Flag Status: -R ------- networkStatusForFlags 2016-10-17 18:49:17.496 chongBa[23417:383815] -canOpenURL: failed for URL: "sinaweibo://" - error: "(null)" 2016-10-17 18:49:17.496 chongBa[23417:383815] -canOpenURL: failed for URL: "sinaweibohd://" - error: "This app is not allowed to query for scheme sinaweibohd" 2016-10-17 18:49:17.528 chongBa[23417:383815] INFO: Reveal Server started (Protocol Version 25). 2016-10-17 18:50:04.191 chongBa[23417:383815] * Terminating app due to uncaught exception 'NSRangeException', reason: '* -[NSArray0 objectAtIndex:]: index 0 beyond bounds for empty NSArray' *** First throw call stack: ( 0 CoreFoundation 0x000000010cc24d85 __exceptionPreprocess + 165 1 libobjc.A.dylib
0x000000010c231deb objc_exception_throw + 48 2 CoreFoundation
0x000000010cbcc885 -[__NSArray0 objectAtIndex:] + 101 3 chongBa
0x00000001080d1ce6 __39-[PBLoginRegisterViewController login:]_block_invoke_3 + 102 4 chongBa
0x00000001080f5480 __46+[PBHttpTool post:parameters:success:failure:]_block_invoke + 112 5 chongBa
0x0000000108086514 __116-[AFHTTPSessionManager dataTaskWithHTTPMethod:URLString:parameters:uploadProgress:downloadProgress:success:failure:]_block_invoke.97 + 228 6 chongBa 0x00000001080a7b19 __72-[AFURLSessionManagerTaskDelegate URLSession:task:didCompleteWithError:]_block_invoke_2.152 + 201 7
libdispatch.dylib 0x000000010d296d9d _dispatch_call_block_and_release + 12 8 libdispatch.dylib 0x000000010d2b73eb _dispatch_client_callout + 8 9 libdispatch.dylib 0x000000010d29f1ef _dispatch_main_queue_callback_4CF + 1738 10 CoreFoundation 0x000000010cb7e0f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
+ 9 11 CoreFoundation 0x000000010cb3fb99 __CFRunLoopRun + 2073 12 CoreFoundation 0x000000010cb3f0f8 CFRunLoopRunSpecific + 488 13 GraphicsServices
0x000000010d798ad2 GSEventRunModal + 161 14 UIKit
0x000000010acb5f09 UIApplicationMain + 171 15 chongBa
0x000000010802287f main + 111 16 libdyld.dylib
0x000000010d2eb92d start + 1 17 ???
0x0000000000000001 0x0 + 1) libc++abi.dylib: terminating with uncaught exception of type NSException

+0

Können Sie die Cras post h loggen? – HarmVanRisk

+0

Ich bearbeite meine Frage und poste das Absturzprotokoll. Ich benutzte Postbote, um API zu testen, sieht aus wie API funktioniert. – Kyle

+0

Der Absturz wird verursacht, indem ein Array außerhalb der Grenzen gesendet wird. Können Sie einen Ausnahme-Haltepunkt einfügen und sehen, ob er an derselben Stelle im Code anhält? – HarmVanRisk

Antwort

0

error: "This app is not allowed to query for scheme

Fehler oben kann vorschlagen LSApplicationQueriesSchemes Schema Eintrag in .plist für URL hinzufügen Sie abfragen:

<key>LSApplicationQueriesSchemes</key> 
<array> 
    <string>YourScheme</string> 
</array> 

Hope this helfen :)

Verwandte Themen