2009-11-26 4 views
0

지도에 주석을 표시하려고합니다. lat와 longi가 문자열 형식입니다. 이제 int로 변환하면됩니다.객관적인 C에서 문자열을 int로 변환하는 방법

NSString *s= @"18.65799"; 
    location1.latitude =[s intValue]; 
    NSLog(@"1%d",[s intValue]); 
      NSString *s1= @"73.774262"; 
    location1.longitude=[s1 intValue]; 

하지만 [(S)가있는 intValue] 넣어 아웃 118 및 널 (location1.latitude "는 1 % @"@) NSLog 대 출력 표시 할 때;

도와주세요.

+0

덕분에 .... – shreedevi

+0

(10) 질문하고, 그 중 18 답 .. . – wkw

답변

5

변경 :

NSLog(@"1%d",[s intValue]); 

에 : S1에 대한 유사

NSLog(@"%d", [s intValue]); 

:이 일을

NSLog(@"%d", [s1 intValue]); 
관련 문제