2011-10-14 3 views

답변

0

리팩터링 후 ARC와 동일한 결과를 얻었습니다.

먼저 viewDidLoad에 다음 코드가 있습니다. "애니메이션 : setUserTrackingMode"

CLLocationManager *lm =[[CLLocationManager alloc] init]; 
lm.delegate = self; 
lm.desiredAccuracy = kCLLocationAccuracyBest; 
[lm startUpdatingLocation]; 

나는 드 headerfile에 다음

@interface ViewController : UIViewController <CLLocationManagerDelegate> 
{ 
CLLocationManager *locationManager; 
} 

@property(nonatomic, strong)CLLocationManager *locationManager; 

그리고

@synthesize locationManager; 

코드 내가있는 viewDidLoad에

locationManager =[[CLLocationManager alloc] init]; 
locationManager.delegate = self; 
locationManager.desiredAccuracy = kCLLocationAccuracyBest; 
[locationManager startUpdatingLocation]; 
0

확인을 변경 않았고 "userTrackingMode". 둘 다 iOS5에서 새로 추가되었습니다. 비슷한 문제가있어서 setUserTrackingMode 함수에서 MKUserTrackingModeFollow를 설정하여 해결했습니다. 기본 추적 모드는 MKUserTrackingModeNone이고 mapView : didUpdateUserLocation을 한 번만 호출한다고 생각합니다.

mapView : didUpdateUserLocation이 호출되지 않는다면 새로운 xcode의 옵션을 살펴보고 콘솔 출력 바로 아래에 ipad에 GPS 아이콘과 같은 아이콘이 있습니다.이 아이콘을 사용하면 위치.

0

오래된 스레드라는 것을 알고 있습니다. 어쨌든 나는 대답 할 것이고, 다른 사람들에게도 도움이 될 것이다.

나는 iOS 6과 비슷한 문제가있었습니다. 어느 것이 mapview 대리인을 자체로 설정하여 해결할 수 있었습니까? 이처럼

:

@interface ViewController : UIViewController <CLLocationManagerDelegate, MKMapViewDelegate> 
:

[mapView setDelegate:self]; 

것은 당신의 ViewController.h이 라인을 따라 MKMapViewDelegate이 있는지 확인

관련 문제