小编Ste*_*ies的帖子

没有用于赋值给属性的Setter方法 - 可可应用程序

我对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)

cocoa objective-c nstextfieldcell

2
推荐指数
1
解决办法
6009
查看次数

标签 统计

cocoa ×1

nstextfieldcell ×1

objective-c ×1