2

我面临着非常奇怪的问题。我Reachability 3.0在我的项目中使用过。

我使用了以下代码

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reachabilityChanged:) name:kReachabilityChangedNotification object:nil];
self.hostReachability = [Reachability reachabilityWithHostName:HOST_NAME];
[self.hostReachability startNotifier];
[self updateInterfaceWithReachability:self.hostReachability];

self.internetReachability = [Reachability reachabilityForInternetConnection];
[self.internetReachability startNotifier];
[self updateInterfaceWithReachability:self.internetReachability];

当构建配置设置为调试模式时,一切都在模拟器和设备中完美运行。现在,当我AdHoc为我的客户进行构建时,当构建配置设置为发布模式时,它会崩溃。

当我从上面评论以下代码时,它工作正常

self.hostReachability = [Reachability reachabilityWithHostName:HOST_NAME];

谁能帮我解决这个问题?

更新: 我的崩溃日志

Date/Time:       2013-09-24 12:52:39.623 +0500
OS Version:      iOS 6.1.3 (10B329)
Report Version:  104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x3b07b350 __pthread_kill + 8
1   libsystem_c.dylib               0x3aff211e pthread_kill + 54
2   libsystem_c.dylib               0x3b02e96e abort + 90
3   libsystem_c.dylib               0x3b00f4cc __assert_rtn + 176
4   SystemConfiguration             0x34a99452 SCNetworkReachabilitySetCallback + 178
5   MYAPPLICATION                           0x000bcdee 0xa1000 + 114158
6   MYAPPLICATION                           0x000a21a8 0xa1000 + 4520
7   UIKit                           0x34b2aad4 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 248
8   UIKit                           0x34b2a65e -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1186
9   UIKit                           0x34b22846 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 694
10  UIKit                           0x34acac34 -[UIApplication handleEvent:withNewEvent:] + 1000
11  UIKit                           0x34aca6c8 -[UIApplication sendEvent:] + 68
12  UIKit                           0x34aca116 _UIApplicationHandleEvent + 6150
13  GraphicsServices                0x367d55a0 _PurpleEventCallback + 588
14  GraphicsServices                0x367d51ce PurpleEventCallback + 30
15  CoreFoundation                  0x32c97170 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
16  CoreFoundation                  0x32c97112 __CFRunLoopDoSource1 + 134
17  CoreFoundation                  0x32c95f94 __CFRunLoopRun + 1380
18  CoreFoundation                  0x32c08eb8 CFRunLoopRunSpecific + 352
19  CoreFoundation                  0x32c08d44 CFRunLoopRunInMode + 100
20  UIKit                           0x34b21480 -[UIApplication _run] + 664
21  UIKit                           0x34b1e2fc UIApplicationMain + 1116
22  MYAPPLICATION                           0x000a209a 0xa1000 + 4250
23  libdyld.dylib                   0x3afb4b1c start + 0

Thread 1:
0   libsystem_kernel.dylib          0x3b07bd98 __workq_kernreturn + 8
1   libsystem_c.dylib               0x3afc9cf6 _pthread_workq_return + 14
2   libsystem_c.dylib               0x3afc9a12 _pthread_wqthread + 362
3   libsystem_c.dylib               0x3afc98a0 start_wqthread + 4

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

Thread 3:
0   libsystem_kernel.dylib          0x3b07bd98 __workq_kernreturn + 8
1   libsystem_c.dylib               0x3afc9cf6 _pthread_workq_return + 14
2   libsystem_c.dylib               0x3afc9a12 _pthread_wqthread + 362
3   libsystem_c.dylib               0x3afc98a0 start_wqthread + 4

Thread 4 name:  WebThread
Thread 4:
0   libsystem_kernel.dylib          0x3b06aeb4 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x3b06b048 mach_msg + 36
2   CoreFoundation                  0x32c97040 __CFRunLoopServiceMachPort + 124
3   CoreFoundation                  0x32c95d9e __CFRunLoopRun + 878
4   CoreFoundation                  0x32c08eb8 CFRunLoopRunSpecific + 352
5   CoreFoundation                  0x32c08d44 CFRunLoopRunInMode + 100
6   WebCore                         0x38c0f500 RunWebThread(void*) + 440
7   libsystem_c.dylib               0x3afd430e _pthread_start + 306
8   libsystem_c.dylib               0x3afd41d4 thread_start + 4

Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x00000000    r1: 0x00000000      r2: 0x00000000      r3: 0x3cb75534
r4: 0x00000006    r5: 0x3cb75b88      r6: 0x34ac01c6      r7: 0x2fd5e710
r8: 0x34ac0171    r9: 0x2fd5e660     r10: 0x3cb75608     r11: 0x20853880
ip: 0x00000148    sp: 0x2fd5e704      lr: 0x3aff2123      pc: 0x3b07b350
cpsr: 0x00000010
4

1 回答 1

0

写在这里只是为了帮助任何有同样问题的人。

我正在使用Xcode 4.6with开发应用程序Reachability version 3.0

当我使用 Xcode 5 运行相同的应用程序时,它运行良好。

因此,作为一种解决方法,现在我正在使用旧版本,Reachability并且它在 Xcode 4.6 上的工作没有任何问题。

于 2013-10-08T10:28:32.983 回答