1

//ビューでロードされました...

self.locationManager =  [[CLLocationManager alloc] init];
self.locationManager.delegate = self;
self.locationManager.distanceFilter = kCLHeadingFilterNone;// kCLHeadingFilterNone;
self.locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation;


- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation     *)newLocation fromLocation:(CLLocation *)oldLocation
{
if (newLocation.course >= 0)
{
    [NSThread detachNewThreadSelector:@selector(showAlertsIfNeededThread) toTarget:self withObject:nil];

}
}

- (void) showAlertsIfNeededThread
{
@autoreleasepool
{
    NSLog(@"Thread started........");
    [NSThread sleepForTimeInterval:3.0];
    //[self showAlertsIfNeeded];
    [self performSelectorOnMainThread:@selector(showAlertsIfNeeded) withObject:nil waitUntilDone:NO];
}
}

いくつかの実行後、スレッドは実行されません。アプリがハングしています。誰でも私を助けることができますか?

前もって感謝します。

4

0 に答える 0