2010年7月12日 星期一

iPhone dev notes 1

可能寫得多java 對住 objective-c 好唔慣

尤其係header /implementation file

啱啱遇上一個bug 

原來synthesize 一個variable 一定係要@implementation 後面

e.g. 

foo.h

@interface foo : UITableViewCell {
NSString *aString;
}
@property (nonatomic ,retain) NSString *aString;

以下會有build error
#import "TodoCell.h"
@synthesize aString;
@implementation TodoCell

以下就無事
#import "TodoCell.h"

@implementation TodoCell
@synthesize aString;

下次都要小心d

沒有留言:

張貼留言