forked from vespassassina-zz/Objective-C-Discogs-Api-Wrapper
/
GSVersion.m
65 lines (49 loc) · 1.37 KB
/
GSVersion.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
//
// GSVersion.m
// DoctorTunes
//
// Created by Diego Trinciarelli on 09/09/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import "GSVersion.h"
@implementation GSVersion
@synthesize status,thumb,format,country,title,label,released,catno,ID;
+ (id)objectWithDictionary:(NSDictionary*)dictionary{
id obj = [[[GSVersion alloc] initWithDictionary:dictionary] autorelease];
return obj;
}
- (id)initWithDictionary:(NSDictionary*)dictionary{
self = [super init];
if (self) {
status = [dictionary objectForKey:@"status"];
thumb = [dictionary objectForKey:@"thumb"];
format = [dictionary objectForKey:@"format"];
country = [dictionary objectForKey:@"country"];
title = [dictionary objectForKey:@"title"];
label = [dictionary objectForKey:@"label"];
released = [dictionary objectForKey:@"released"];
catno = [dictionary objectForKey:@"catno"];
ID = [dictionary objectForKey:@"id"];
}
return self;
}
- (NSString *)itemid{
return ID;
}
- (NSString *)description
{
return [NSString stringWithFormat:@"[%@] %@", ID, title];
}
- (void)dealloc{
[status release];
[thumb release];
[format release];
[country release];
[title release];
[label release];
[released release];
[catno release];
[ID release];
[super dealloc];
}
@end