views:

494

answers:

4
NSString *latitude = [[NSString alloc] initWithFormat:@"%g°", coordinate.latitude];
NSString *longitude = [[NSString alloc] initWithFormat:@"%g°", coordinate.longitude];
self.pointLabel.text = [latitude stringByAppendingString:@", "];
self.pointLabel.text = [self.pointLabel.text stringByAppendingString:longitude];
+7  A: 
self.pointLabel.text = [NSString stringWithFormat:@"%gº, %gº", coordinate.latitude, coordinate.longitude];
Dave DeLong
Thanks, works like charm.
Andrew Johnson
+2  A: 

Yep.

self.pointLabel.text = [NSString stringWithFormat @"%g°, %g°", coordinate.latitude, coordinate.longitude];
BJ Homer
+2  A: 

Yes. Vote for me ;)

self.pointLabel.text = [NSString stringWithFormat @"%g°, %g°", coordinate.latitude, coordinate.longitude];
Reed Olsen
+2  A: 

In addition to what the other three said, your code is leaking two objects. Please review the memory management rules.

Ahruman