Skip to content

Instantly share code, notes, and snippets.

@ianpetzer
Created June 12, 2013 11:31
Show Gist options
  • Save ianpetzer/5764534 to your computer and use it in GitHub Desktop.
Save ianpetzer/5764534 to your computer and use it in GitHub Desktop.
IN .h
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
// This is an optional property from MKAnnotation
@property (nonatomic, copy) NSString *title;
IN .m
@synthesize coordinate, title;
- (id)initWithCoordinate:(CLLocationCoordinate2D)c title:(NSString *)t
{
self = [super init];
if (self) {
coordinate = c;
[self setTitle:t];
}
return self;
}
Whats the diff?
coordinate = c;
[self setTitle:t];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment