Interface Builder没有看到MacRuby的出口

我试图使用XCode和Interface Builder获得一个基本的hello world应用程序。 但是,在Interface Builder中,我无法看到我的sockets连接起来。 我转到对象检查器窗格的连接选项卡,并显示“New Referencing Outlet”。

我想知道我的代码是否错误。 这里是

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_label,hello_button和changeLabel,但我没有。 我想也许我在某个地方拼错了,但这似乎也不是。 这是两个界面构建器窗口的镜头。

替代文字

任何帮助表示赞赏。 我想我只是忽略了一些东西,但不确定。

更新:我通过重新安装OS X解决了这个问题。我怀疑是因为安装了X Code 4而出现问题,不知道。 但是,它现在可以全新安装OS X,X Code和MacRuby

我遇到了类似的问题http://www.mail-archive.com/macruby-devel@lists.macosforge.org/msg05331.html

通过重新安装XCode后重新安装MacRuby来解决这个问题。

如果您使用的是XCode 4.1或4.2,则无需重新安装,就像我刚刚做的那样 – 它现在真的被破坏了。 查看此故障单何时修复,以及解决方法。

如果您升级到Xcode 4.3+,则需要按照以下说明操作:

http://lldong.github.com/blog/2012/03/05/xcode-4-dot-3-macruby-compatible-problem-workaround/

它将带来你的Macruby项目模板并修复rb_nibtool

MacRuby安装了文件和项目模板以及允许IB / Xcode将UI元素链接到MacRuby代码的工具,反之亦然。 在某些情况下,升级Xcode或安装iOS SDK会破坏Xcode桥接,您需要重新安装MacRuby。 请注意,如果Xcode4仅在MacRuby 0.10或更新版本中受支持。 (我今天刚刚在主干中编辑了Xcode 4模板,他们应该在几天内发布0.10版本)。

此问题已在Xcode 4.2中得到解决。

正如另一个答案所示,Xcode 4.1有一个错误,即IB无法识别MacRuby类中的出口。 它在Xcode 4.2中得到纠正。 但是,如果升级到4.2,则必须重新安装MacRuby MacRuby出口才能重新开始工作。

Interesting Posts