Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Subclassed MKPlacemark to allow storing of placemark coordinate
- Loading branch information
1 parent
4a01571
commit 8e8ff1d
Showing
6 changed files
with
64 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// SVPlacemark.h | ||
// SVGeocoder | ||
// | ||
// Created by Sam Vermette on 01.05.11. | ||
// Copyright 2011 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import <MapKit/MapKit.h> | ||
|
||
@interface SVPlacemark : MKPlacemark { | ||
|
||
} | ||
|
||
@property (nonatomic, readwrite) CLLocationCoordinate2D coordinate; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// SVPlacemark.m | ||
// SVGeocoder | ||
// | ||
// Created by Sam Vermette on 01.05.11. | ||
// Copyright 2011 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import "SVPlacemark.h" | ||
|
||
|
||
@implementation SVPlacemark | ||
|
||
@synthesize coordinate; | ||
|
||
- (id)initWithCoordinate:(CLLocationCoordinate2D)aCoordinate addressDictionary:(NSDictionary *)addressDictionary { | ||
|
||
if(self = [super initWithCoordinate:aCoordinate addressDictionary:addressDictionary]) | ||
self.coordinate = aCoordinate; | ||
|
||
return self; | ||
} | ||
|
||
- (NSString*)description { | ||
|
||
NSDictionary *coordDict = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:self.coordinate.latitude], @"latitude", [NSNumber numberWithFloat:self.coordinate.longitude], @"longitude", nil]; | ||
|
||
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:coordDict, @"coordinate", self.addressDictionary, @"address", nil]; | ||
|
||
return [dict description]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters