AFNetworking AFNetworkReachabilityCallback错误(Ipad IOS6.3)

时间:2013-07-31 14:09:07

标签: ios afnetworking

我的APP在(ipad 6.1模拟器,ipad 6.0模拟器和ipad 5.1模拟器)中运行良好。 但是在安装到我的ipad之后,它已经不再适用了。

我使用Organizer-Dervices调试错误,并收到错误消息:

Console:

Jul 31 21:55:27 Sandy ReportCrash[937] : Formulating crash report for process BenefitPad[781]
Jul 31 21:55:27 Sandy ReportCrash[937] : libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Dervice Logs:

Incident Identifier: F6306353-BEF8-4626-8FA1-17F8C829AEE4
CrashReporter Key:   1a786173c1c72ae5d44172b3d641feee8e91a4af
Hardware Model:      iPad3,3
Process:         BenefitPad [778]
Path:            /var/mobile/Applications/D733430C-510D-4D2A-9D88-6361A6074485/BenefitPad.app/BenefitPad
Identifier:      BenefitPad
Version:         ??? (???)
Code Type:       ARM (Native)
Parent Process:  launchd [1]

Date/Time:       2013-07-31 19:46:51.989 +0800
OS Version:      iOS 6.1.3 (10B329)
Report Version:  104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x75417466
Crashed Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libobjc.A.dylib                 0x3935c52c objc_retain + 12
1   BenefitPad                      0x001571fe 0xe8000 + 455166
2   CoreFoundation                  0x3140c034 _CFXNotificationPost + 1424
3   Foundation                      0x31d22594 -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
4   Foundation                      0x31d26056 -[NSNotificationCenter postNotificationName:object:] + 26
5   BenefitPad                      0x0010cc12 0xe8000 + 150546
6   BenefitPad                      0x000fe2da 0xe8000 + 90842
7   BenefitPad                      0x00134cd8 0xe8000 + 314584
8   BenefitPad                      0x00135d02 0xe8000 + 318722
9   libdispatch.dylib               0x3977711c _dispatch_call_block_and_release + 8
10  libdispatch.dylib               0x397764b4 _dispatch_client_callout + 20
11  libdispatch.dylib               0x3977b1b8 _dispatch_main_queue_callback_4CF$VARIANT$mp + 220
12  CoreFoundation                  0x3148ef36 __CFRunLoopRun + 1286
13  CoreFoundation                  0x31401eb8 CFRunLoopRunSpecific + 352
14  CoreFoundation                  0x31401d44 CFRunLoopRunInMode + 100
15  GraphicsServices                0x34fb62e6 GSEventRunModal + 70
16  UIKit                           0x333172fc UIApplicationMain + 1116
17  BenefitPad                      0x000fd92c 0xe8000 + 88364
18  BenefitPad                      0x000e9aec 0xe8000 + 6892

Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0   libsystem_kernel.dylib          0x3984d648 kevent64 + 24
1   libdispatch.dylib               0x3977d974 _dispatch_mgr_invoke + 792
2   libdispatch.dylib               0x3977d654 _dispatch_mgr_thread$VARIANT$mp + 32

Thread 2 name:  WebThread
Thread 2:
0   libsystem_kernel.dylib          0x3984ceb4 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x3984d048 mach_msg + 36
2   CoreFoundation                  0x31490040 __CFRunLoopServiceMachPort + 124
3   CoreFoundation                  0x3148ed9e __CFRunLoopRun + 878
4   CoreFoundation                  0x31401eb8 CFRunLoopRunSpecific + 352
5   CoreFoundation                  0x31401d44 CFRunLoopRunInMode + 100
6   WebCore                         0x373f1500 _ZL12RunWebThreadPv + 440
7   libsystem_c.dylib               0x397b630e _pthread_start + 306
8   libsystem_c.dylib               0x397b61d4 thread_start + 4

Thread 3:
0   libsystem_kernel.dylib          0x3985dd98 __workq_kernreturn + 8
1   libsystem_c.dylib               0x397abcf6 _pthread_workq_return + 14
2   libsystem_c.dylib               0x397aba12 _pthread_wqthread + 362
3   libsystem_c.dylib               0x397ab8a0 start_wqthread + 4

Thread 4:
0   libsystem_kernel.dylib          0x3985dd98 __workq_kernreturn + 8
1   libsystem_c.dylib               0x397abcf6 _pthread_workq_return + 14
2   libsystem_c.dylib               0x397aba12 _pthread_wqthread + 362
3   libsystem_c.dylib               0x397ab8a0 start_wqthread + 4

该方法可能发生错误(文件:AFHTTPClient.m行:309):

static void AFNetworkReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNetworkReachabilityFlags flags, void *info) {
    AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags);
    AFNetworkReachabilityStatusBlock block = (__bridge AFNetworkReachabilityStatusBlock)info;
    if (block) {
        block(status);
    }

    dispatch_async(dispatch_get_main_queue(), ^{
        NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
        [notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:[NSDictionary dictionaryWithObject:[NSNumber numberWithInteger:status] forKey:AFNetworkingReachabilityNotificationStatusItem]];
    });
}

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

我已经解决了这个问题。

原因是作为'NSDecimalNumber'的属性,在我将'NSDecimalNumber'改为'NSString'之后,它运行良好。

这个问题与“AFNetworking”无关。