Ruby Motion – Access Controller in the Console

Much easier with bubble-wrap gem installed.

In the console I can then type: App.window.rootViewController.childViewControllers

Which in my case shows:

=> [#, #]

So to get access to the UserController I can do

userController = App.window.rootViewController.childViewControllers[1]
=> #

Remember to declare variables as attr_accessor