当我调用 readFromData:(NSData *)data ofType:(NSString*)string 时,NSTextView 不会初始化
我有一个刷新显示:调用 NSTextView 的 setString:方法的方法。我可以保存和加载,但是当我加载时,即使我的程序加载了数据,它也不会按应有的方式将其显示在 NSTextView 上。我做了检查,加载时 NSTextView 似乎为零,这就是为什么 setString: 方法不对它执行任何操作。我认为这个 textView 将由界面生成器初始化。有什么建议吗?谢谢。
I have a refreshDisplay: method that calls the setString: method of an NSTextView. I can save, and load, but when I load even though my program loads the data, it does not display it on the NSTextView as it should. I did a check and that NSTextView seems to be nil when I load, which is why the setString: method does not do anything to it. I thought this textView would be initialized by interface builder. Any suggestions? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
文本视图是否在类的界面中标记为
IBOutlet
,并且您确定它已正确连接到笔尖中的相应对象吗?如果是,那么您的NSTextField
ivar 就没有理由nil
。Is the text view marked as an
IBOutlet
in your class's interface, and are you sure it is properly connected to the appropriate object in your nib? If it is, then there should be no reason for yourNSTextField
ivar to benil
.