Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interface Builder not Seeing Outlets with MacRuby

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

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.

alt text

Any help is appreciated. I think I am just overlooking something, but not sure.

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

like image 358
Buddy Lindsey Avatar asked Jan 03 '11 02:01

Buddy Lindsey


3 Answers

I had a similar problem http://www.mail-archive.com/[email protected]/msg05331.html

it was fixed by reinstalling MacRuby after a reinstall of XCode.

like image 67
ian Avatar answered Nov 09 '22 13:11

ian


No need to reinstall if you are on XCode 4.1 or 4.2, like I just did - it is truly broken now. See this ticket for when it is fixed, and a workaround.

like image 30
Magnar Avatar answered Nov 09 '22 13:11

Magnar


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/

It will bring bace your Macruby project templates and fix rb_nibtool

like image 31
colinta Avatar answered Nov 09 '22 14:11

colinta