BW:Location using deprecated delegate methods

14 views
Skip to first unread message

Nick

unread,
Mar 27, 2014, 8:25:10 PM3/27/14
to bubbl...@googlegroups.com
The delegate method "locationManager(manager, didUpdateToLocation:newLocation, fromLocation:oldLocation)" is deprecated in iOS6.

Instead, the following should be used:

locationManager(manager, didUpdateToLocations:locations)

Is anyone working on this? I'd be happy to update it but there are a few things in the module that I just don't understand. Namely the highlighted section:

    def locationManager(manager, didUpdateToLocation:newLocation, fromLocation:oldLocation)
      if @options[:once]
        @callback && @callback.call(newLocation)
        @callback = proc { |result| }
        stop
      else
        @callback && @callback.call({to: newLocation, from: oldLocation})
      end
    end

The line above it passes the newLocation back to the block if the callback is defined, but what is the purpose of the line below it?  Why is the callback variable set to a do-nothing block?


Nick
Reply all
Reply to author
Forward
0 new messages