• R/O
  • HTTP
  • SSH
  • HTTPS

提交

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

iSightを使ってBooklog,MediaMarkerインポート用CSVファイルを生成するアプリ


Commit MetaInfo

修订版f8c40d46acb1cf8beec86188da6eece7d76e47ff (tree)
时间2011-03-02 21:19:35
作者masakih <masakih@user...>
Commitermasakih

Log Message

[Mod] CoreDataのスカラ値のアクセサの実装を今風に変更。

更改概述

差异

--- a/BEBookInformation.h
+++ b/BEBookInformation.h
@@ -10,25 +10,22 @@
1010
1111
1212 @interface BEBookInformation : NSManagedObject
13-{
14- BOOL exported;
15-}
1613
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;
2522
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;
3229
3330 @property BOOL exported;
3431
--- a/BEBookInformation.m
+++ b/BEBookInformation.m
@@ -8,6 +8,10 @@
88
99 #import "BEBookInformation.h"
1010
11+@interface BEBookInformation (BEPrivate)
12+@property (nonatomic, retain) NSNumber *primitiveExported;
13+@end
14+
1115
1216 @implementation BEBookInformation
1317 @dynamic isbn;
@@ -28,26 +32,18 @@
2832
2933 @dynamic exported;
3034
31-- (BOOL)primitiveExported
32-{
33- return exported;
34-}
35-- (void)setPrimitiveExported:(BOOL)flag
36-{
37- exported = flag;
38-}
3935 - (BOOL)exported
4036 {
41- BOOL val;
4237 [self willAccessValueForKey:@"exported"];
43- val = exported;
38+ NSNumber *val = [self primitiveExported];
4439 [self didChangeValueForKey:@"exported"];
45- return val;
40+ return val ? [val boolValue] : NO;
4641 }
4742 - (void)setExported:(BOOL)flag
4843 {
44+ NSNumber *val = [NSNumber numberWithBool:flag];
4945 [self willChangeValueForKey:@"exported"];
50- exported = flag;
46+ [self setPrimitiveExported:val];
5147 [self didChangeValueForKey:@"exported"];
5248 }
5349