[MacRuby-devel] XCode 4 -- I Must Be Missing Something

steve ross cwdinfo at gmail.com
Mon Apr 4 16:21:40 PDT 2011


I was using XCode 3 and everything was a breeze, but a new MacRuby project in XCode 4 seems like pulling teeth. I'm sure someone has run across this, so I'll ask. I read Matt's chapter on XCode 4, read the redwoodapp.posterous.com article on setting the targets, and can get the thing to run and the main window to display. So here's the proble:

I have a Ruby class, ApplicationController, and I've hooked one button, one label, and one slider to it using IB. I declared the outlets as attr_writer and the method signature for the action is on_randomize(sender).

I created an awakeFromNib method. In this method, I put:

puts "hello, world"

It never prints to the console. Main window displays fine. No puts. I changed the File's Owner to ApplicationController (although it shouldn't matter, because it's not document-oriented). Still nothing.

I added puts statements to app_delegate.rb and nothing there is being executed.

I added puts statements to rb_main.rb and it is being loaded, and the Ruby files are being required.

The only build error is as follows:

2011-04-04 16:08:53.742 Random Password Generator[79326:903] loaded rb_main
2011-04-04 16:08:53.751 Random Password Generator[79326:903] requiring AppDelegate
2011-04-04 16:08:53.756 Random Password Generator[79326:903] requiring ApplicationController
2011-04-04 16:08:53.805 Random Password Generator[79326:903] Could not connect the action on_randomize: to target of class ApplicationController

The first 3 lines are my debug statements in rb_main.rb. The third one, "Could not connect..." is the one I'm having trouble interpreting.

Any pointers as to why my code simply doesn't hook up?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20110404/d6530f7f/attachment.html>


More information about the MacRuby-devel mailing list