-
Notifications
You must be signed in to change notification settings - Fork 3
/
ApplicationListResponse.m
63 lines (43 loc) · 1.71 KB
/
ApplicationListResponse.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
59
60
61
62
63
//
// ApplicationListResponse.m
// HudsonMobile
//
// Created by simone on 5/28/11.
// Copyright 2011 LMIT ltd. All rights reserved.
//
#import "ApplicationListResponse.h"
@implementation ApplicationListResponse
@synthesize applicationList;
- (id)init {
self = [super init];
if (self) {
applicationList = [[NSMutableArray alloc] init];
}
return self;
}
-(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *) namespaceURI qualifiedName:(NSString *)qName
attributes: (NSDictionary *)attributeDict{
if(currentReadCharacters!=nil){
[currentReadCharacters release];
currentReadCharacters = nil;
}
if ([elementName caseInsensitiveCompare:@"applicationinfo"]==NSOrderedSame) {
currentInfo = [[ApplicationInfo alloc] init];
}
}
-(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName{
if([elementName caseInsensitiveCompare:@"id"]==NSOrderedSame){
[currentInfo setAppId:currentReadCharacters];
}else if([elementName caseInsensitiveCompare:@"title"]==NSOrderedSame){
[currentInfo setTitle:currentReadCharacters];
}else if([elementName caseInsensitiveCompare:@"status"]==NSOrderedSame){
[currentInfo setStatus:currentReadCharacters];
}else if([elementName caseInsensitiveCompare:@"url"]==NSOrderedSame){
[currentInfo setUrl:currentReadCharacters];
}else if([elementName caseInsensitiveCompare:@"created"]==NSOrderedSame){
//TODO
}else if([elementName caseInsensitiveCompare:@"applicationinfo"]==NSOrderedSame){
[applicationList addObject:currentInfo];
}
}
@end