2011-04-22 91 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