【发布时间】:2014-12-12 19:34:54
【问题描述】:
我想在故事板文件的 NSTextView Outlet 中显示一些文本(字符串),但它不起作用。我不确定我是否使用了最好的方法。选择的方法“insertText”是否正确?插座连接是否正确?故事板是否支持 NSTextView 类?
非常感谢任何帮助。
ViewController.h
@interface ViewController : NSViewController
@property (unsafe_unretained) IBOutlet NSTextView *closerText;
@end
ViewController.c
@implementation ViewController
@synthesize closerText;
- (void)viewDidLoad {
[super viewDidLoad];
[closerText insertText:@"Hello World"];
}
@end
【问题讨论】:
标签: objective-c storyboard nstextview outlet