colinta / teacup

This project has been sunset in favor of MotionKit
github.com/motion-kit/motion-kit
Other
604 stars 85 forks source link

motion-layout exception #140

Open fearoffish opened 10 years ago

fearoffish commented 10 years ago

When I add motion-layout and a simple auto block, teacup gives me an exception. Do I need specific versions?

  * motion-layout (0.0.1)
  * sugarcube (1.3.5)
  * teacup (2.1.13)

My simple controller is:

  layout do
    subview(UIImageView, :felt)

    auto do
      horizontal "|-[felt]-]"
    end
  end

The exception:

(main)> 2013-11-11 12:10:45.885 pokal[31689:80b] Exception executing layout(UIView(#938d9d0, [[0.0, 0.0], [320.0, 568.0]])) in #<HomeController:0x938cdf0> (stylesheet=#<Teacup::Stylesheet:0x908dd70>)
2013-11-11 12:10:46.189 pokal[31689:80b] layout.rb:178:in `layout:': exception class/object expected (TypeError)
    from teacup_controller.rb:101:in `teacupDidLoad'
    from ui_view_controller.rb:6:in `viewDidLoad'
    from app_delegate.rb:6:in `application:didFinishLaunchingWithOptions:'
2013-11-11 12:10:46.190 pokal[31689:80b] layout.rb:178:in `layout:': exception class/object expected (TypeError)
    from teacup_controller.rb:101:in `teacupDidLoad'
    from ui_view_controller.rb:6:in `viewDidLoad'
    from app_delegate.rb:6:in `application:didFinishLaunchingWithOptions:'
2013-11-11 12:10:46.193 pokal[31689:80b] *** Terminating app due to uncaught exception 'TypeError', reason: 'layout.rb:178:in `layout:': exception class/object expected (TypeError)
    from teacup_controller.rb:101:in `teacupDidLoad'
    from ui_view_controller.rb:6:in `viewDidLoad'
    from app_delegate.rb:6:in `application:didFinishLaunchingWithOptions:'

If I remove the auto block the exception goes away.

colinta commented 10 years ago

Hey Jamie sorry I never got back to you on this - code looks right, and I can't reproduce. The specs test the Motion::Layout integration, and look very similar (add a subview, add constraints using auto).

colinta commented 10 years ago

Controller code: https://github.com/rubymotion/teacup/blob/master/app/controllers/motion_layout_controller.rb

Spec: https://github.com/rubymotion/teacup/blob/master/spec/ios/motion_layout_spec.rb