-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGSSearchResult.m
55 lines (44 loc) · 1.02 KB
/
GSSearchResult.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
//
// GSSearchResult.m
// DoctorTunes
//
// Created by Diego Trinciarelli on 08/09/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import "GSSearchResult.h"
@implementation GSSearchResult
@synthesize thumb,title,type,uri,summary;
+ (id)objectWithDictionary:(NSDictionary*)dictionary{
id obj = [[[GSSearchResult alloc] initWithDictionary:dictionary] autorelease];
return obj;
}
- (id)initWithDictionary:(NSDictionary*)dictionary{
self = [super init];
if (self) {
[self setValuesForKeysWithDictionary:dictionary];
}
return self;
}
- (NSString *)itemid{
if(uri){
NSArray * a = [uri componentsSeparatedByString:@"/"];
return [a lastObject];
}
else
{
return nil;
}
}
- (NSString *)description
{
return [NSString stringWithFormat:@"[%@][%@] %@ - %@", type,self.itemid, title, uri];
}
- (void)dealloc{
[thumb release];
[title release];
[type release];
[uri release];
[summary release];
[super dealloc];
}
@end