-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSWPostTableItem.m
58 lines (45 loc) · 1.3 KB
/
SWPostTableItem.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//
// SWPostTableItem.m
// StarWorld
//
// Created by Aaron Baker on 10/2/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import "SWPostTableItem.h"
@implementation SWPostTableItem
@synthesize ID;
@synthesize starCount;
@synthesize x;
@synthesize y;
///////////////////////////////////////////////////////////////////////////////////////////////////
+ (id)itemWithTitle:(NSString*)title
caption:(NSString*)caption
text:(NSString*)text
timestamp:(NSDate*)timestamp
ID:(NSInteger)itemID
starcount:(NSInteger)itemStarCount
x:(float)x
y:(float)y
URL:(NSString*)URL {
SWPostTableItem* item = [[[self alloc] init] autorelease];
item.title = title;
item.caption = caption;
item.text = text;
item.timestamp = timestamp;
item.ID = itemID;
item.starCount = itemStarCount;
item.URL = URL;
item.x = x;
item.y = y;
return item;
}
- (NSString*) description {
return [NSString stringWithFormat:@"X: %f, Y: %f, TEXT: %@",self.x,self.y,self.text];
}
- (CLLocationCoordinate2D) getCoordinate {
CLLocationCoordinate2D coord;
coord.latitude = self.y;
coord.longitude = self.x;
return coord;
}
@end