small medium large xlarge

Back to: All Forums  RubyMotion
Generic-user-small
25 Apr 2016, 17:34
Bernard Kaiflin (14 posts)

This error is probably due to changes in Xcode since the book was printed. Using recent versions (RubyMotion Starter 4.11 and Xcode 7.3), depending on the example, it is preceded by

  • Terminating app due to uncaught exception
  • Assertion failure

This blog http://blog.motioninmotion.tv/gaining-control-of-rubymotion-with-uiviewcontrollers/ gives a solution.

My solution is simply adding the following line in app_delegate.rb :

@window.rootViewController = UIViewController.new

Example for Boxey_textfield :

class AppDelegate
  def application(application, didFinishLaunchingWithOptions:launchOptions)
    @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
    @window.backgroundColor = UIColor.whiteColor
    @window.makeKeyAndVisible

    # added :
    @window.rootViewController = UIViewController.new

etc...
You must be logged in to comment