views:

39

answers:

2

How do I print the value of -> event.latitude = [[values objectAtIndex:0] floatValue]; ?

Below is some of my code:

@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];

How do I print out event.latitude?

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

Thanks guys.

+1  A: 

Try this

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

Notice the format string

Nick
+1  A: 

If you're just trying to print it out, why not try:

NSLog(@"%f", event.latitude);
Ryan