0
아이폰 3gs 또는 iphone4에서 나침반과 같은보기를 만들려고합니다. 어떻게 시작할 수 있을지 아는 사람이 있습니까?이 문제에 대한 정보가 너무 많습니다. 북쪽을 따라 항상 화살표 만 그려야합니다. 내가 사용하고 IOS 사전에 4.0어떻게 ios4에서 아이폰 3gs 같은 나침반을 그릴 수 있습니까?
감사와
아이폰 3gs 또는 iphone4에서 나침반과 같은보기를 만들려고합니다. 어떻게 시작할 수 있을지 아는 사람이 있습니까?이 문제에 대한 정보가 너무 많습니다. 북쪽을 따라 항상 화살표 만 그려야합니다. 내가 사용하고 IOS 사전에 4.0어떻게 ios4에서 아이폰 3gs 같은 나침반을 그릴 수 있습니까?
감사와
시작 제목 업데이트 :
if([CLLocationManager headingAvailable]) {
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
// myDelegateObject is an instance of a class implementing the CLLocationManagerDelegate protocol
locationManger.delegate = myDelegateObject;
[locationManager startUpdatingHeading];
}
당신의 클래스 중 하나에 CLLocationManagerDelegate 프로토콜을 구현 - 같은 특히, 뭔가 :
을-(void)locationManager:(CLLocationManager*)manager didUpdateHeading:(CLHeading*)heading {
// CLLocationDirection is a double typedef
CLLocationDirection headingInDegrees = heading.magneticHeading;
// you'll have to implement this in some fashion...
[myCompassViewController rotateCompassImageToHeading:headingInDegrees];
}