2

私はこれに数日間取り組んできました。これが何を意味するのか分かりますか?助けてください!さらに情報が必要な場合はお知らせください

EXC_BAD_ACCESS(SIGSEGV)

スレッド11名:ディスパッチキュー:com.apple.CoreLocation.ConnectionClient.0x200826b0.eventsスレッド11クラッシュ:0 libdispatch.dylib 0x387b2420 dispatch_sync_f $ VARIANT $ mp + 0 1 CoreLocation 0x393c8088 CLConnectionClient :: setCachedResponse(CLConnectionMessage *、bool(block_pointer)( ))+ 76 2 CoreLocation 0x393c8558 __setDefaultMessageHandler_onQueue_block_invoke_0 + 28 3 CoreLocation 0x393c7070 __setEventHandler_block_invoke_0 + 344 4 libxpc.dylib 0x367ef7e4 _xpc_connection_mach_event + 768 5 libdispatch.dylib 0x387b6524 _dispatch_mach_msg_invoke $ VARIANT $ MP + 120 6 libdispatch.dylib 0x387b2e8e _dispatch_queue_drain $ VARIANT $ MP + 78 7 libdispatch 。dylib 0x387b67b2 _dispatch_mach_invoke $ VARIANT $ mp + 158 8 libdispatch.dylib 0x387b2e8e _dispatch_queue_drain $ VARIANT $ mp + 78 9 libdispatch.dylib 0x387b2dbc _dispatch_queue_invoke $ VARIANT $ mp + 36 _dispatch_queue_invoke $ VARIANT $ mp + 36 12 libdispatch.dylib 0x387b391a _dispatch_root_queue_drain + 182 13 libdispatch.dylib 0x387b3abc _dispatch_worker_thread2 + 80 14 libsystem_c.dylib 0x34097a0e _pthread_wqthread + 358dylib 0x387b2e8e _dispatch_queue_drain $ VARIANT $ mp + 78 9 libdispatch.dylib 0x387b2dbc _dispatch_queue_invoke $ VARIANT $ mp + 36 10 libdispatch.dylib 0x387b2e8e _dispatch_queue_drain $ VARIANT $ mp + 78 11 libdispatch. _dispatch_root_queue_drain + 182 13 libdispatch.dylib 0x387b3abc _dispatch_worker_thread2 + 80 14 libsystem_c.dylib 0x34097a0e _pthread_wqthread + 358 15 libsystem_c.dylib 0x340978a0 start_wqthread + 4dylib 0x387b2e8e _dispatch_queue_drain $ VARIANT $ mp + 78 9 libdispatch.dylib 0x387b2dbc _dispatch_queue_invoke $ VARIANT $ mp + 36 10 libdispatch.dylib 0x387b2e8e _dispatch_queue_drain $ VARIANT $ mp + 78 11 libdispatch. _dispatch_root_queue_drain + 182 13 libdispatch.dylib 0x387b3abc _dispatch_worker_thread2 + 80 14 libsystem_c.dylib 0x34097a0e _pthread_wqthread + 358 15 libsystem_c.dylib 0x340978a0 start_wqthread + 4dylib 0x387b2e8e _dispatch_queue_drain $ VARIANT $ MP + 78 11 libdispatch.dylib 0x387b2dbc _dispatch_queue_invoke $ VARIANT $ MP + 36 12 libdispatch.dylib 0x387b391a _dispatch_root_queue_drain + 182 13 libdispatch.dylib 0x387b3abc _dispatch_worker_thread2 + 80 14 libsystem_c.dylib 0x34097a0e _pthread_wqthread + 358 15 libsystem_c.dylib 0x340978a0 start_wqthread + 4dylib 0x387b2e8e _dispatch_queue_drain $ VARIANT $ MP + 78 11 libdispatch.dylib 0x387b2dbc _dispatch_queue_invoke $ VARIANT $ MP + 36 12 libdispatch.dylib 0x387b391a _dispatch_root_queue_drain + 182 13 libdispatch.dylib 0x387b3abc _dispatch_worker_thread2 + 80 14 libsystem_c.dylib 0x34097a0e _pthread_wqthread + 358 15 libsystem_c.dylib 0x340978a0 start_wqthread + 4dylib 0x34097a0e _pthread_wqthread + 358 15 libsystem_c.dylib 0x340978a0 start_wqthread + 4dylib 0x34097a0e _pthread_wqthread + 358 15 libsystem_c.dylib 0x340978a0 start_wqthread + 4

- (void)startupLocationManager
{
    // startup location manager for background processing
    if (self.locationManager == nil)
    {
        self.locationManager = [[CLLocationManager alloc] init];
        self.locationManager.delegate = self;
        self.locationManager.distanceFilter = kCLDistanceFilterNone;
        self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
        [self.locationManager startUpdatingLocation];

    }
}

- (void)stopLocationManager
{
    if (self.locationManager)
    {
        [self.locationManager stopUpdatingLocation];
        self.locationManager.delegate = nil;
        self.locationManager = nil;

        if (self.isInBackground == YES)
        {
            [self startupLocationManager];
        }
    }
}
4

1 に答える 1

1

他の投稿の助けを借りて解決策を見つけました。タイミングの問題であることが判明しました。ロケーションマネージャーをリセットする別のメソッドを作成し、それを遅らせて呼び出しました。これですべてが修正されました。これがあなたにも役立つことを願っています。

- (void)stopLocationManager
{
    if (locationManager)
    {
        [locationManager stopUpdatingLocation];
        [self performSelector:@selector(discardLocationManager) withObject:nil afterDelay:0.1];
    }
}

- (void) discardLocationManager
{
    locationManager.delegate = nil;
    locationManager = nil;

    if (self.isRestart == YES)
    {
        [self performSelector:@selector(startupLocationManager) withObject:nil afterDelay:0.1];
    }
}
于 2013-03-09T17:59:40.667 に答える