Проблемы с CoreLocation Framework - PullRequest
0 голосов
/ 23 июля 2011

Я использовал базовую систему определения местоположения для получения своих GPS-координат в моем IPOD. Сначала я могу получить Широту и долготу, затем я получил сообщение об ошибке, kCLErrorDomain Code = 0 Операция не может быть завершена.

Но сообщение об ошибке никогда не меняется. Я думаю, что в первый раз только оно работает

Это мой код

#import "CoreLocationDemoViewController.h"

@implementation CoreLocationDemoViewController

@synthesize CLController;

- (void)viewDidLoad {
    [super viewDidLoad];

    CLController = [[CoreLocationController alloc] init];
    CLController.delegate = self;
    [CLController.locMgr startUpdatingLocation];
}

- (void)locationUpdate:(CLLocation *)location {
    speedLabel.text = [NSString stringWithFormat:@"SPEED: %f", [location speed]];
    latitudeLabel.text = [NSString stringWithFormat:@"LATITUDE: %f", location.coordinate.latitude];
    longitudeLabel.text = [NSString stringWithFormat:@"LONGITUDE: %f", location.coordinate.longitude];
    altitudeLabel.text = [NSString stringWithFormat:@"ALTITUDE: %f", [location altitude]];
    errorLabel.text = @"";
}

- (void)locationError:(NSError *)error {

    if(!CLController) //.text )
    {   
    errorLabel.text = [error description];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
    return YES;
}

- (void)viewDidUnload {
}

- (void)dealloc {
    [CLController release];
    [super dealloc];
}

@end

Кто-нибудь знает, в чем проблемы, помощь высоко ценится.

Спасибо, VKS

1 Ответ

1 голос
/ 23 июля 2011

Да, у iPod нет функции GPS.Протестируйте приложение на симуляторе или iPhone, а не на iPod.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...