iSightを使ってBooklog,MediaMarkerインポート用CSVファイルを生成するアプリ
Revision | 57ff07bb3a124cb032798e96e8301bbbc61e0e6f (tree) |
---|---|
Time | 2011-03-06 12:46:10 |
Author | masakih <masakih@user...> |
Commiter | masakih |
[Mod] 不要なインスタンス変数を削除。
@@ -10,9 +10,6 @@ | ||
10 | 10 | |
11 | 11 | @class BEBookInformation; |
12 | 12 | @interface BEAmazonLookup : NSObject |
13 | -{ | |
14 | - NSDateFormatter *timestampDateFormatter; | |
15 | -} | |
16 | 13 | |
17 | 14 | + (BEAmazonLookup *)sharedInstance; |
18 | 15 |
@@ -11,16 +11,13 @@ | ||
11 | 11 | |
12 | 12 | #import "BEAmazonRequestGenerator.h" |
13 | 13 | |
14 | -NSXMLElement *firstElementForName(NSXMLElement *parent, NSString *name); | |
15 | - | |
14 | +NSXMLElement *firstElementForName(NSXMLElement *parent, NSString *name) | |
15 | +{ | |
16 | + NSArray *children = [parent elementsForName:name]; | |
17 | + if(!children || [children count] == 0) return nil; | |
18 | + return [children objectAtIndex:0]; | |
19 | +} | |
16 | 20 | |
17 | -//NSString* encodeURIComponent(NSString* s) { | |
18 | -// return [((NSString*)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, | |
19 | -// (CFStringRef)s, | |
20 | -// NULL, | |
21 | -// (CFStringRef)@"!*'();:@&=+$,/?%#[]", | |
22 | -// kCFStringEncodingUTF8)) autorelease]; | |
23 | -//} | |
24 | 21 | NSString* deodeURIComponent(NSString* s) { |
25 | 22 | return [((NSString*)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault, |
26 | 23 | (CFStringRef)s, |
@@ -69,27 +66,14 @@ static BEAmazonLookup *sharedInstance = nil; | ||
69 | 66 | return self; |
70 | 67 | } |
71 | 68 | |
72 | -- (id)init | |
73 | -{ | |
74 | - if(self = [super init]) { | |
75 | - timestampDateFormatter = [[NSDateFormatter alloc] init]; | |
76 | - [timestampDateFormatter setDateFormat:@"YYYY-MM-dd'T'HH':'mm':'ss'Z'"]; | |
77 | - } | |
78 | - return self; | |
79 | -} | |
80 | -/* Never called. | |
81 | -- (void)dealloc | |
82 | -{ | |
83 | - [timestumpDateFormatter release]; | |
84 | - [super dealloc]; | |
85 | -} | |
86 | -*/ | |
69 | + | |
87 | 70 | - (void)parseError:(NSXMLElement *)items |
88 | 71 | { |
89 | 72 | id request = firstElementForName(items, @"Request"); |
90 | 73 | id errors = firstElementForName(request, @"Errors"); |
91 | 74 | id error = firstElementForName(errors, @"Error"); |
92 | 75 | if(error) { |
76 | + NSLog(@"%@", error); | |
93 | 77 | NSBeep(); |
94 | 78 | } |
95 | 79 | } |
@@ -144,12 +128,7 @@ static BEAmazonLookup *sharedInstance = nil; | ||
144 | 128 | id publicationDate = firstElementForName(itemAttrs, @"PublicationDate"); |
145 | 129 | book.publicationDate = [publicationDate objectValue]; |
146 | 130 | } |
147 | -NSXMLElement *firstElementForName(NSXMLElement *parent, NSString *name) | |
148 | -{ | |
149 | - NSArray *children = [parent elementsForName:name]; | |
150 | - if(!children || [children count] == 0) return nil; | |
151 | - return [children objectAtIndex:0]; | |
152 | -} | |
131 | + | |
153 | 132 | - (void)lookupBooks:(NSArray *)books |
154 | 133 | { |
155 | 134 | for(id book in books) { |