How does this condition work? I’m unable to comprehend this.
if ([newLocation.timestamp timeIntervalSince1970] < [NSDate timeIntervalSinceReferenceDate] - 60) return;
Reference: More iPhone 3 Development – Tackling iPhone SDK 3
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’ll go with what Jason suggested. I wrote a blog post for this on the book’s forum but i never heard back!
“This condition doesn’t work reliably, assuming that newLocation is an instance of CLLocation. It’s using two different bases, but I would assume the check is meant to test whether some location information is less than 60 seconds old. Both should be either timeIntervalSince1970 or timeIntervalSinceReferenceDate (i.e., have the same basis). (Also we assume he meant [[NSDate date] dateWithTimeIntervalSinceReferenceDate] since the other would throw an exception).” – Jason Coco