When creating a custom initialiser for UIViewController (Rubymotion)
Always make sure to return self at the end of the initializer function. For ex:
class MapViewController < UIViewController
attr_accessor :lat,:lng
def initWithCoord(params={})
self.lat = params[:lat]
self.lng = params[:lng]
self #important!
end
end
Not doing this will give you a runtime error NSInvalidArgumentException










