rubymotion-community / BubbleWrap

Cocoa wrappers and helpers for RubyMotion (Ruby for iOS and OS X) - Making Cocoa APIs more Ruby like, one API at a time. Fork away and send your pull requests
Other
1.18k stars 208 forks source link

location get_once returns [CLLocationManager copyWithZone:]: unrecognized selector sent to instance #487

Open jelmerderonde opened 8 years ago

jelmerderonde commented 8 years ago

The following code returns [CLLocationManager copyWithZone:]: unrecognized selector sent to instance:

include BW::Location

def get_location
  if BW::Location.enabled? && BW::Location.authorized?
    BW::Location.get_once(desired_accuracy: :nearest_ten_meters) do |user_location|
      if user_location.is_a?(CLLocation)
        mp user_location.coordinate.latitude
      else
        NSLog("Error getting location: %@", user_location[:error])
      end
    end
  end
end

I have messing around with it all day but can't get it fixed. Could it be a bug in BW::Location?