Objective-C stub for message not precompiled?


I’ve started working through Clay Allsopp’s RubyMotion book, but am getting stuck on the interactive debugging section (page 9, specifically). It’s basically a hello world app, where AppDelegate set an @alert instance variable using UIAlertView.alloc.initWithTitle and then calling show inside the application instance method.

Everything works fine in the simulator but trying to change the alert’s attributes in the REPL fails. I’m getting a good reference to the alert object using alert = UIApplication.sharedApplication.delegate.instance_variable_get("@alert"), but trying to call alert.title = 'foo' results in the following error message:

Objective-C stub for message setTitle:' typev@:@’ not precompiled. Make sure you properly link with the framework or library that defines this message. Remote process has quit.

Has anyone encountered a similar issue or know of any potential resolutions?


When you see this message in the REPL, try putting the code in you .rb files and try again.


Thanks, also using UIAlertView.new over UIAlertView.alloc.initWithTitle prevents these failures. It seems this book may have some outdated syntax.