2010-07-16 6 views
0

-> event.latitude = [[값 objectAtIndex : 0] floatValue]; 값을 인쇄하려면 어떻게해야합니까? ?개체 변수를 인쇄하는 방법은 무엇입니까?

@interface SeismicEvent : NSObject <MKAnnotation>{ 
    float latitude; 
    float longitude; 


**This is an object 
SeismicEvent *event; 


** This reads in a float 

event.latitude = [[values objectAtIndex:0] floatValue]; 

가 어떻게 event.latitude을 인쇄하는 방법 : 아래

내 코드의 일부인가?

나는있는 NSString에게 *str = [NSString stringWithFormat:@"%@", event.latitude];

고마워 했어요. 당신은 단지 그것을 밖으로 인쇄하려는 경우

+0

당신은 목적-C 태그를 추가해야 이 질문에. –

+1

@Jesse Dhillon - 평판이 500이 넘기 때문에 태그를 편집 할 수 있습니다. –

+0

새내기 질문에 대해 죄송합니다. – Morry

답변

2

NSString *str = [NSString stringWithFormat:@"%f", event.latitude]; 

공지 사항을 형식 문자열

1

을 시도, 왜 시도하지 :

NSLog(@"%f", event.latitude); 
관련 문제