2010-04-11 125 views
0

This tutorial on mobileorchard.com使用2個類別(或2個.h和.m)來實現核心位置。我可以在現有班級中使用所有內容嗎?我會怎麼做?核心位置問題

我可以使用我現有的應用程序委託作爲位置委託嗎?

而且,是

- (id) init { 
    self = [super init]; 
    if (self != nil) { 
     self.locationManager = [[[CLLocationManager alloc] init] autorelease]; 
     self.locationManager.delegate = self; // send loc updates to myself 
    } 
    return self; 
} 

方法相同的通常initWithNib

我試圖快速實施一些基於位置信息的東西。描述上述鏈接教程的幫助很有幫助。

謝謝。不 - 真的,謝謝。

回答

0

是的,當然。您也可以讓委派人員成爲地點經理代表。你只需要在那裏實現CLLocationManagerDelegate方法:

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation 

獲取位置更新。

+0

...我跟着在我的課上實現相應的類方法? – Moshe 2010-04-11 13:04:54