-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPOIDetailResp.m
More file actions
66 lines (55 loc) · 1.58 KB
/
Copy pathPOIDetailResp.m
File metadata and controls
66 lines (55 loc) · 1.58 KB
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
59
60
61
62
63
64
65
66
//
// POIDetailResp.m
// TwentyFirstCenturyTag
//
// Created by Christopher Ballinger on 7/12/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import "POIDetailResp.h"
@implementation POIDetailResp
@synthesize poi;
@synthesize points;
@synthesize ownerId;
@synthesize ownerName;
@synthesize users;
@synthesize history;
-(id)init
{
self = [super init];
if(self)
{
APITYPE = @"POIDetailResp";
POI = @"poi";
OWNER = @"tag_owner";
POINTS = @"points";
USERS = @"users";
NAME = @"name";
TEAMID = @"id";
TEAMPOINTS = @"points";
HISTORY = @"events";
}
return self;
}
-(void) parseDictionary:(NSDictionary *)fields
{
[super parseDictionary:fields];
self.poi = [[Venue alloc] initWithDictionary:fields];
self.ownerId = [[fields objectForKey:OWNER] objectForKey:TEAMID];
self.ownerName = [[fields objectForKey:OWNER] objectForKey:NAME];
self.points = [[[fields objectForKey:OWNER] objectForKey:TEAMPOINTS] intValue];
NSArray * rawHistory = [fields objectForKey:HISTORY];
NSMutableArray * tempHistory = [[NSMutableArray alloc] initWithCapacity:[rawHistory count]];
for (int i =0; i<[rawHistory count]; i++)
{
Event * event = [[Event alloc] initWithDictionary:[rawHistory objectAtIndex:i]];
NSLog(@"Event msg: %@",event.msg);
[tempHistory addObject:event];
}
history = tempHistory;
NSLog(@"Venue: %@",poi);
}
-(NSString *)description
{
return self.poi.description;
}
@end