Skip to main content

Is startUpdatingMyLocation mandatory to call the location manager"s didUpdateToLocation method in iphone sdk



I need a clarification that. Is startUpdatingMyLocation method mandatory to call didUpdateToLocation? isn't the didUpdateToLocation method automatically called when the location is updated?





Guy's please clear my clarification.


Comments

  1. The documents state


    Start standard location services by calling the startUpdatingLocation
    method. This service is most appropriate for applications that need
    more fine-grained control over the delivery of location events.
    Specifically, it takes into account the values in the desiredAccuracy
    and distanceFilter property to determine when to deliver new events.
    The precision of the standard location services are needed by
    navigation applications or any application where high-precision
    location data or a regular stream of updates is required. However,
    these services typically require the location-tracking hardware to be
    enabled for longer periods of time, which can result in higher power
    usage.

    For applications that do not need a regular stream of location events,
    consider using the startMonitoringSignificantLocationChanges method to
    start the delivery of events instead. This method is more appropriate
    for the majority of applications that just need an initial user
    location fix and need updates only when the user moves a significant
    distance. This interface delivers new events only when it detects
    changes to the device’s associated cell towers, resulting in less
    frequent updates and significantly lower power usage.

    Regardless of which location service you use, location data is
    reported to your application via the location manager’s associated
    delegate object. Because it can take several seconds to return an
    initial location, the location manager typically delivers the
    previously cached location data immediately and then delivers more
    up-to-date location data as it becomes available. Therefore it is
    always a good idea to check the timestamp of any location object
    before taking any actions. If both location services are enabled
    simultaneously, they deliver events using the same set of delegate
    methods.


    So you can use any of the two , either startUpdatingLocation or startMonitoringSignificantLocationChanges to get the location updates but you will have to call any one of these for the delegate method being called. (IMHO)

    ReplyDelete

Post a Comment

Popular posts from this blog

Why is this Javascript much *slower* than its jQuery equivalent?

I have a HTML list of about 500 items and a "filter" box above it. I started by using jQuery to filter the list when I typed a letter (timing code added later): $('#filter').keyup( function() { var jqStart = (new Date).getTime(); var search = $(this).val().toLowerCase(); var $list = $('ul.ablist > li'); $list.each( function() { if ( $(this).text().toLowerCase().indexOf(search) === -1 ) $(this).hide(); else $(this).show(); } ); console.log('Time: ' + ((new Date).getTime() - jqStart)); } ); However, there was a couple of seconds delay after typing each letter (particularly the first letter). So I thought it may be slightly quicker if I used plain Javascript (I read recently that jQuery's each function is particularly slow). Here's my JS equivalent: document.getElementById('filter').addEventListener( 'keyup', function () { var jsStart = (new Date).getTime()...

Is it possible to have IF statement in an Echo statement in PHP

Thanks in advance. I did look at the other questions/answers that were similar and didn't find exactly what I was looking for. I'm trying to do this, am I on the right path? echo " <div id='tabs-".$match."'> <textarea id='".$match."' name='".$match."'>". if ($COLUMN_NAME === $match) { echo $FIELD_WITH_COLUMN_NAME; } else { } ."</textarea> <script type='text/javascript'> CKEDITOR.replace( '".$match."' ); </script> </div>"; I am getting the following error message in the browser: Parse error: syntax error, unexpected T_IF Please let me know if this is the right way to go about nesting an IF statement inside an echo. Thank you.