0

I was suprise when i saw that my app can't know where I am located with a MapKit on iOS6 !

I just want to zoom to user's location when the map is starting ! How can I do it ?

Please help me

Thank you so much !! (PS: I saw that the CLCoordinate for sending a request for routing is working fine)

4

1 に答える 1

2

showsUserLocation は効果がないということですか? または、現在地の監視が現在地を更新していませんか? iOS 6で両方をテストしましたが、うまくいきました。たぶん、いくつかのコードを投稿できます。

編集:

アプリで位置監視が有効になっていないようです。まず、cllocation manager を有効にするには、次のようにする必要があります:

if (nil == locationManager)
    locationManager = [[CLLocationManager alloc] init];

//set the delegate for the location manager
locationManager.delegate = self;
// set your desired accuracy
locationManager.desiredAccuracy = kCLLocationAccuracyKilometer;

[locationManager startUpdatingLocation];

その時点で、青いロケーション インジケーターが表示されます。マップで showsUserLocation = YES を設定している限り。

于 2012-09-30T17:28:36.593 に答える