0
我有CLLocation變量聲明,我給它的值,但是當我在其他地方使用它,與應用程序崩潰控制檯「調試終止」沒有任何日誌應用程序崩潰與「調試終止」
CLLocation *userLoc;
-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
userLoc=newLocation;
[self somefunction];
}
-(void) somefunction
{
NSLog(@"%@",userLoc);
}
這裏登錄userLoc正確
但在我的另一種方法
- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath*) indexPath
{
NSLog(@"%@",userLoc);
}
這裏應用程序崩潰。 請幫忙
我沒有聲望投票你回答了......但+1爲你的答案..明白瞭解 – 2010-10-18 10:14:54