繼續獲取EXC_BAD_ACCESS。冉NSZombieEnabled並沒有想出什麼。CoreLocation在設備上崩潰但不在模擬器上
在模擬器控制檯:
2010-09-11 23:39:56.876 [19072:207] 1.309789, lat, 103.772196, lon
在設備控制檯:
EXC_BAD_ACCESS
的代碼行:
NSLog(@"%f, lat, %f, lon",latitudeString,longitudeString);
什麼CLManager正在做:
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
NSLog(@"Entering mlocationmanager did updatetolocation");
latitudeString = [NSString stringWithFormat:@"%f", newLocation.coordinate.latitude];
longitudeString = [NSString stringWithFormat:@"%f", newLocation.coordinate.longitude];
NSLog(@"lat %@ long %@", latitudeString, longitudeString);
NSLog(@"%@",newLocation.description);
if (latitudeString.length >0 && longitudeString.length > 0){
NSLog(@"Yes both are more than 0");
locationIsReady = YES;
}
[self.tableView reloadData];
}
這裏發生了什麼?這兩個變量都在我的頭文件中,並且CLLocationManagerDelegate符合。在這工作了幾個小時,但沒有運氣。希望你們能幫忙。
NSString *latitudeString;
NSString *longitudeString;
你不知道爲什麼所以你移動了一些代碼,現在它恰好工作。我認爲你最好找到真正的原因。 – 2010-09-11 18:05:40
你的代碼肯定是做錯了事;你可能只是在別的地方把碰撞移開了。儘管如此, – 2010-09-12 13:28:04