Created
February 29, 2016 17:38
-
-
Save bgerstle/d7f518aca5c7892fc362 to your computer and use it in GitHub Desktop.
TIL: Locations don't pass NSCoding round trip (location != itself when written/read from disk)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import CoreLocation | |
let l = CLLocation(latitude: 0, longitude: 0) | |
let data = NSKeyedArchiver.archivedDataWithRootObject(l) | |
let lprime = NSKeyedUnarchiver.unarchiveObjectWithData(data) as! CLLocation | |
l == lprime | |
// $R0: Bool = false | |
l.description | |
// $R2: String = "<+0.00000000,+0.00000000> +/- 0.00m (speed -1.00 mps / course -1.00) @ 2/29/16, 12:34:25 PM Eastern Standard Time" | |
lprime.description | |
// $R3: String = "<+0.00000000,+0.00000000> +/- 0.00m (speed -1.00 mps / course -1.00) @ 2/29/16, 12:34:25 PM Eastern Standard Time" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment