我正在尝试使用 XCode 和 Interface Builder 构建一个基本的 hello world 应用程序。但是,在 Interface Builder 中我看不到连接的插座。我转到对象检查器窗格的连接选项卡,它显示“新引用插座”。
我想知道我的代码是否错误。这里是
class HelloWorldController
attr_accessor :hello_label, :hello_button, :hello
def awakeFromNib
@hello = true
end
def changeLabel(sender)
if @hello
@hello_label.stringValue = "Good Bye"
@hello_button.title = "Hello"
@hello = false
else
@hello_label.stringValue = "Hello World"
@hello_button.title = "Good Bye"
@hello = true
end
end
end
据我了解,我应该能够看到 hello、hello_label、hello_button 和 changeLabel,但我看不到。我想也许我在某个地方拼写错误,但似乎也不是这样。这是两个界面生成器窗口的截图。
任何帮助表示赞赏。我想我只是忽略了一些事情,但不确定。
更新:我通过重新安装 OS X 解决了这个问题。我怀疑有问题,因为安装了 X Code 4,不知道。不过,它现在可以与全新安装的 OS X、X Code 和 MacRuby 一起使用
我有类似的问题http://www.mail-archive.com/[电子邮件受保护]/msg05331.html
通过在重新安装 XCode 后重新安装 MacRuby 来修复该问题。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)