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];
views:
494answers:
4
+7
A:
self.pointLabel.text = [NSString stringWithFormat:@"%gº, %gº", coordinate.latitude, coordinate.longitude];
Dave DeLong
2009-07-08 23:44:29
Thanks, works like charm.
Andrew Johnson
2009-07-08 23:45:54
+2
A:
Yep.
self.pointLabel.text = [NSString stringWithFormat @"%g°, %g°", coordinate.latitude, coordinate.longitude];
BJ Homer
2009-07-08 23:45:05
+2
A:
Yes. Vote for me ;)
self.pointLabel.text = [NSString stringWithFormat @"%g°, %g°", coordinate.latitude, coordinate.longitude];
Reed Olsen
2009-07-08 23:46:01
+2
A:
In addition to what the other three said, your code is leaking two objects. Please review the memory management rules.
Ahruman
2009-07-09 13:53:41