2012-04-04 6 views
1

MKMapView에서 일부 위치를 표시하려고합니다. mapViewController를로드하는 중 콘솔에서 다음 오류 메시지가 표시됩니다.iOS 5.1에서 MKMapView를로드 할 수 없습니다.

__GEORegisterNetworkDefaults_block_invoke_0 : 나는 내 응용 프로그램을 위해 엑스 코드 4.3과 아이폰 OS 5.1을 사용하고 com.apple.geod.defaults

에 geod에 연결할 수 없습니다.

내가 주소를 표시하려면 다음 코드를 사용하고 있습니다 :

- (void) showAddress 
{ 
    MKCoordinateRegion region; 
    MKCoordinateSpan span; 
    span.latitudeDelta = 0.2; 
    span.longitudeDelta = 0.2; 

    CLLocationCoordinate2D location = [self addressLocation]; 
    region.span = span; 
    region.center = location; 
} 

그리고 코드를 다음에서 주소 위치를 얻기를위한

.
-(CLLocationCoordinate2D) addressLocation 
{ 
    NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%@&output=csv", 
          [@"cupertino" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; 
    NSError *err; 
    NSString *locationString = [NSString stringWithContentsOfURL:[NSURL URLWithString:urlString] encoding:NSUTF8StringEncoding error:&err]; 
    NSArray *listItems = [locationString componentsSeparatedByString:@","]; 

    double latitude = 0.0; 
    double longitude = 0.0; 

    if([listItems count] >= 4 && [[listItems objectAtIndex:0] isEqualToString:@"200"]) 
    { 
     latitude = [[listItems objectAtIndex:2] doubleValue]; 
     longitude = [[listItems objectAtIndex:3] doubleValue]; 
    } 

    CLLocationCoordinate2D location; 
    location.latitude = latitude; 
    location.longitude = longitude; 

    return location; 
} 

나는 mapkit 자습서에 대해 구글

는 난 아무도 내가 위의 오류를 얻고있다 이유를 알고 있나요 http://mithin.in/2009/06/22/using-iphone-sdk-mapkit-framework-a-tutorial

에서 위의 코드를 발견?

답변

1

앱에서 위치 정보에 액세스해야한다고 Xcode에 알려 봤습니까? 나는 그것이 '특권'또는 프로젝트 구성과 비슷한 것으로 생각한다.

+0

프로젝트 구성에서 '특권'또는 이와 유사한 것을 얻지 못했습니다. –

관련 문제