-
Notifications
You must be signed in to change notification settings - Fork 1
/
Location.m
43 lines (32 loc) · 903 Bytes
/
Location.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// Location.m
// Nodobo Replay
//
// Created by Stephen Bell on 18/10/2010.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "Location.h"
@implementation Location
@synthesize latitude;
@synthesize longitude;
+ (Location *) locationWithLatitude: (NSString * ) lat longitude: (NSString * ) lon timestamp: (NSDate * ) t
{
return [[[Location alloc] initWithLatitude: lat longitude: lon timestamp: t] autorelease];
}
- (Location *) initWithLatitude: (NSString * ) lat longitude: (NSString * ) lon timestamp: (NSDate * ) t
{
self = [super init];
if (self == nil)
return nil;
[latitude autorelease];
latitude = [lat copy];
[longitude autorelease];
longitude = [lon copy];
timestamp = [t retain];
return self;
}
- (NSString * ) data
{
return [NSString stringWithFormat: @"%@,%@", latitude, longitude];
}
@end