2011-04-22 90 views
0

什麼是‘(’是什麼意思?預期標識符「(」前「合成」

而且遇到問題的代碼IM是

#import <UIKit/UIKit.h> 

@interface ZelNoteAppDelegate : NSObject <UIApplicationDelegate> {   
    UIWindow *window;   
    UITextField *textfield;  
    UITextView *textview;   
} 

@property (nonatomic, retain) IBOutlet UIWindow *window;  
(@synthesize, @dynamic UITextField *textfield;  
@synthesize, @dynamic UITextView *textview;  
@end 
+2

爲什麼你看起來習慣於在你的代碼中放置'(Apple的所有代碼都沒有說你需要放置它們?) – BoltClock 2011-04-22 23:53:44

+2

...你爲什麼要在頭文件中綜合這些屬性? – 2011-04-23 00:13:27

+2

螺栓和卡爾是正確的 - 在審查你的問題歷史後,它看起來像我只是在做東西,希望編譯器計算出來。編程不會像那樣工作,我擔心 - 您實際上需要閱讀文檔並學習語言。 – 2011-04-23 00:58:24

回答

1
#import <UIKit/UIKit.h> 

@interface ZelNoteAppDelegate : NSObject <UIApplicationDelegate> {   
    UIWindow *window;   
    UITextField *textfield;  
    UITextView *textview;   
} 
@property (nonatomic, retain) IBOutlet UIWindow *window; 
@property (nonatomic, retain) UITextField *textfield;  
@property (nonatomic, retain) UITextView *textview;  
@end 

@interface ZelNoteAppDelegate 
@synthesize window, textField, textView; 
// ... 
@end 

它會幫助你重新閱讀The Objective-C Programming Language