2011-07-23 10 views
-1

私のIPODでGPS座標を受け取るためにコアロケーションフレームワークを使用しました。最初に緯度と経度を取得できますが、エラーメッセージが表示されます。kCLErrorDomainコード= 0操作を完了できませんでした。CoreLocation Frameworkの問題

しかし、最初の時だけ、それは

これをうまくいくと思うんchange.I決してエラーメッセージの問題が何であるかを誰もが知っている

#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

+0

コードにコードをマークしてください。それはほとんど読めません。 –

+1

@vks、あなたはIpodで現在の位置を取得できません。 iPodはGPS機能を持っていないので。 – Sisu

+0

しかし私は最初に正しいGPS座標を得て、次にエラーメッセージを受け取った、私のiPodは無線LAN接続を持っています – vks

答えて

1

はいiPodはGPS機能を持っていません。シミュレータまたはiPhoneのいずれかであなたのアプリをテストしてください。

+0

私は正しいGPS座標を最初に得て、次にエラーメッセージを受け取りました、私のiPodはWiFi接続を持っています – vks

関連する問題