xcode - '(' 之前的预期标识符 'Synthesize"

标签 xcode ios macos

“(”是什么意思?

我遇到问题的代码是

#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

最佳答案

#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 .

关于xcode - '(' 之前的预期标识符 'Synthesize",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5761125/

相关文章:

iphone - 如何让我的事件指示器 View 覆盖所有屏幕?

arrays - 从核心数据获取并放入数组时出现问题

objective-c - iOS 3.2 及更高版本提供了哪些网络服务器通信技术?

ios - 点击 UITextField 或 UITextView 时崩溃 : Assertion failure in -[UICalloutBarButton layoutSublayersOfLayer:]

swift - 如何在 macOS 上将 iPhone 设为 AVCaptureDevice?

objective-c - 使用 Xcode 将数字存储在变量中后,如何使用 NSUserDefaults 存储日期

iphone - 有没有办法在 iOS 中为 float 添加逗号,或者至少将其显示为货币?

iphone - 想从邮政编码中获取州名

swift - NSSegmentedControl 不会使模板图像变暗

objective-c - 如何将 OpenOffice Calc 嵌入到我自己的应用程序中?