I have CLLocation variable declared i gave it a value but when i use it at other place, app crash with "Debugging Terminated" without any logs in console
CLLocation *userLoc;
-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
userLoc=newLocation;
[self somefunction];
}
-(void) somefunction
{
NSLog(@"%@",userLoc);
}
here it log userLoc properly
but in my other method
- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath*) indexPath
{
NSLog(@"%@",userLoc);
}
here app crash. Please help