Interface Builder没有看到MacRuby的出口 [英] Interface Builder not Seeing Outlets with MacRuby
问题描述
我正在尝试使用XCode和Interface Builder获得一个基本的hello world应用程序。但是,在Interface Builder中,我无法看到我的插座连接起来。我转到对象检查器窗格的连接选项卡,它显示New Referencing Outlet。
I am trying to get a basic hello world application going using XCode and Interface Builder. However, in Interface Builder I can't see my outlets to wire things up with. I go to the connections tab of the objects inspector pane and it says "New Referencing Outlet".
我想知道我的代码是否错误。这是
I am wondering if my code is wrong. Here it is
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,但我没有。我想也许我在某个地方拼错了,但这似乎也不是。下面是两个界面构建器窗口的镜头。
As I understand it I should be able to see hello, hello_label, hello_button, and changeLabel, but I don't. I thought maybe I had a misspelling somewhere, but that doesn't seem to be it either. Here is a shot of the two interface builder windows.
感谢任何帮助。我想我只是忽略了一些东西,但不确定。
Any help is appreciated. I think I am just overlooking something, but not sure.
更新:我通过重新安装OS X解决了这个问题。我怀疑是因为X代码存在问题4安装,不知道。但是,它现在可以全新安装OS X,X Code和MacRuby
UPDATE: I solved the problem by just re-installing OS X. I suspect there was a problem because X Code 4 was installed, no idea. However, it now works with a fresh install of OS X, X Code and MacRuby
推荐答案
如果升级到Xcode 4.3+,您需要按照以下说明操作:
If you upgrade to Xcode 4.3+, you will need to follow these instructions:
http://lldong.github.com/blog/2012/03/05/xcode-4-dot-3-macruby-compatible-problem -workaround /
它会带来你的Macruby项目模板并修复rb_nibtool
It will bring bace your Macruby project templates and fix rb_nibtool
这篇关于Interface Builder没有看到MacRuby的出口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!