我对objective-c相当新,刚遇到一个我以前没见过的错误.我正在尝试将文本字段单元格设置为"可选",但我得到错误"没有Setter方法'setIsSelectable'用于赋值给属性."
这是.h和.m文件.谢谢.
DataPanel.h
#import <Cocoa/Cocoa.h>
@interface DataPanel : NSPanel
@property (weak) IBOutlet NSTextFieldCell *textField;
@end
DataPanel.m
#import "DataPanel.h"
@implementation DataPanel
@synthesize textField = _textField;
- (void) awakeFromNib{
_textField.stringValue = @"1.1 Performance standards The overall objective of the performance standards in Section 1.1 is to provide acoustic conditions in schools that (a) facilitate clear communication of speech between teacher and student, and between students, and (b) do not interfere with study activities.";
_textField.isSelectable = YES;
}
@end
Run Code Online (Sandbox Code Playgroud)