RubyMotion

Unable to find a specification for ...

If anyone else is getting:

Unable to find a specification for … (libPusher in my case)

or the following:

Could not find cocoapods-0.19.1 in any of the sources

or even:

Pod::DSLError - Invalid Facebook-iOS-SDK.podspec file: undefined method `prepare_command=' for #

definitely try adding:

gem "cocoapods", '~> 0.23.0'

to your Gemfile, and then running:

pod setup && bundle update && bundle install

I guess there was a recent CocoaPods update that broke something with RubyMotion and motion-cocoapods.. or something.

RubyMotion OSX NSTableView example

(using AutoLayout)

I struggled a little to get a basic NSTableView working in RubyMotion, coming from an iOS background, as I couldn't find any conclusive 'hello world'-esque examples. So, here's mine.

clone on github

It's also useful to see how to create your first window, as the difference between NSViewController and NSWindowController isn't immediately obvious either. There's a helpful explanation of this on StackOverflow.

Once I'd got it working, I converted it to use AutoLayout. Note the sequence that I use to setup AutoLayout:

init_views
configure_views
place_views
constrain_viewsa

I find this sequence helps categorise what can be a complicated setup (if it were a more complicated controller, at least).

To get started (note that RubyMotion 2 is required for OSX support):

bash $ cd motion-nstableview-example $ rake