iSightを使ってBooklog,MediaMarkerインポート用CSVファイルを生成するアプリ
Revisão | f8c40d46acb1cf8beec86188da6eece7d76e47ff (tree) |
---|---|
Hora | 2011-03-02 21:19:35 |
Autor | masakih <masakih@user...> |
Commiter | masakih |
[Mod] CoreDataのスカラ値のアクセサの実装を今風に変更。
@@ -10,25 +10,22 @@ | ||
10 | 10 | |
11 | 11 | |
12 | 12 | @interface BEBookInformation : NSManagedObject |
13 | -{ | |
14 | - BOOL exported; | |
15 | -} | |
16 | 13 | |
17 | -@property (retain) NSString *isbn; | |
18 | -@property (retain) NSString *category; | |
19 | -@property (retain) NSDate *registerDate; | |
20 | -@property (retain) NSArray *tags; | |
21 | -@property (retain) NSString *review; | |
22 | -@property (retain) NSNumber *rating; | |
23 | -@property (retain) NSNumber *status; | |
24 | -@property (retain) NSDate *readDate; | |
14 | +@property (nonatomic, retain) NSString *isbn; | |
15 | +@property (nonatomic, retain) NSString *category; | |
16 | +@property (nonatomic, retain) NSDate *registerDate; | |
17 | +@property (nonatomic, retain) NSArray *tags; | |
18 | +@property (nonatomic, retain) NSString *review; | |
19 | +@property (nonatomic, retain) NSNumber *rating; | |
20 | +@property (nonatomic, retain) NSNumber *status; | |
21 | +@property (nonatomic, retain) NSDate *readDate; | |
25 | 22 | |
26 | -@property (retain) NSString *title; | |
27 | -@property (retain) NSString *asin; | |
28 | -@property (retain) NSString *amazonISBN; | |
29 | -@property (retain) NSString *author; | |
30 | -@property (retain) NSString *manufacturer; | |
31 | -@property (retain) NSDate *publicationDate; | |
23 | +@property (nonatomic, retain) NSString *title; | |
24 | +@property (nonatomic, retain) NSString *asin; | |
25 | +@property (nonatomic, retain) NSString *amazonISBN; | |
26 | +@property (nonatomic, retain) NSString *author; | |
27 | +@property (nonatomic, retain) NSString *manufacturer; | |
28 | +@property (nonatomic, retain) NSDate *publicationDate; | |
32 | 29 | |
33 | 30 | @property BOOL exported; |
34 | 31 |
@@ -8,6 +8,10 @@ | ||
8 | 8 | |
9 | 9 | #import "BEBookInformation.h" |
10 | 10 | |
11 | +@interface BEBookInformation (BEPrivate) | |
12 | +@property (nonatomic, retain) NSNumber *primitiveExported; | |
13 | +@end | |
14 | + | |
11 | 15 | |
12 | 16 | @implementation BEBookInformation |
13 | 17 | @dynamic isbn; |
@@ -28,26 +32,18 @@ | ||
28 | 32 | |
29 | 33 | @dynamic exported; |
30 | 34 | |
31 | -- (BOOL)primitiveExported | |
32 | -{ | |
33 | - return exported; | |
34 | -} | |
35 | -- (void)setPrimitiveExported:(BOOL)flag | |
36 | -{ | |
37 | - exported = flag; | |
38 | -} | |
39 | 35 | - (BOOL)exported |
40 | 36 | { |
41 | - BOOL val; | |
42 | 37 | [self willAccessValueForKey:@"exported"]; |
43 | - val = exported; | |
38 | + NSNumber *val = [self primitiveExported]; | |
44 | 39 | [self didChangeValueForKey:@"exported"]; |
45 | - return val; | |
40 | + return val ? [val boolValue] : NO; | |
46 | 41 | } |
47 | 42 | - (void)setExported:(BOOL)flag |
48 | 43 | { |
44 | + NSNumber *val = [NSNumber numberWithBool:flag]; | |
49 | 45 | [self willChangeValueForKey:@"exported"]; |
50 | - exported = flag; | |
46 | + [self setPrimitiveExported:val]; | |
51 | 47 | [self didChangeValueForKey:@"exported"]; |
52 | 48 | } |
53 | 49 |