Developer Area

Changeset 676

Show
Ignore:
Timestamp:
01/20/10 12:56:11 (4 years ago)
Author:
henri
Message:

Discard location updates more than 1 hour old

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • apps/iphone/my.tel/trunk/Classes/MyCLController.m

    r626 r676  
    2525                self.locationManager.delegate = self; // Tells the location manager to send updates to this object 
    2626                self.myCurrentLoc = [[CLLocation alloc] initWithLatitude:0 longitude:0]; 
     27                [self.locationManager startUpdatingLocation]; 
    2728        } 
    2829        return self; 
     
    4748        //      } 
    4849     
     50        // Check the timestamp, see if it's an hour old or more. If so, don't send an update 
     51        if (ABS([newLocation.timestamp timeIntervalSinceNow]) > 3600) { 
     52                [self.delegate gpsUpdate:nil]; 
     53                return; 
     54        } 
     55         
    4956        [myCurrentLoc release]; 
    5057    myCurrentLoc = [newLocation copy]; // TODO: Why does this increment the retain count? We should be manually retaining 
    5158         
    52         // send the timestamp 
     59        // Looks like the loc is good 
    5360        [self.delegate gpsUpdate:myCurrentLoc]; 
    5461        return; 
Telnic
Search This Site
Partners
Neustar
ICANN
Main site | WHOIS | Sell .tel | FAQ | Archived Site | About Telnic | Contact Us