I have created one segmented control and a text view in my .xib file and I have declare it in .h file as
@interface controlsViewControll开发者_StackOverflow中文版er : UIViewController {
IBOutlet UISegmentedControl *colorChooser;
IBOutlet UITextView *setText;
}
@property (nonatomic,retain) UISegmentedControl *colorChooser;
@property (nonatomic,retain) UITextView *setText
but it shows me warning on both lines of @property
Can anyone tell me why it warns me?
My guess would be that you don't have a @synthesize or @dynamic in your implementation. That would generate compiler warnings.
The position of the IBOutlet wound not generate a compiler warning as it's a marco of nothing. It's used by xcode resource editor (or the older Interface Builder) to indicate it's a outlet property and doesn't generate any code.
@interface controlsViewController : UIViewController {
UISegmentedControl *colorChooser;
UITextView *setText;
}
@property (nonatomic,retain) IBOutlet UISegmentedControl *colorChooser;
@property (nonatomic,retain) IBOutlet UITextView *setText;
You need to synthesize the property in your .m file. You won't get the error then.
精彩评论