swift2.0后請使用var location:CLLocation = locations[locations.count-1] as! CLLocation
2015-08-03
func ios8() -> Bool{
var systemVersion = (UIDevice.currentDevice().systemVersion as NSString).floatValue
println(systemVersion)
return systemVersion >= 8.0
}
var systemVersion = (UIDevice.currentDevice().systemVersion as NSString).floatValue
println(systemVersion)
return systemVersion >= 8.0
}
2015-08-03
如果輸出Error Domain=kCLErrorDomain Code=0 "The operation couldn’t be completed. (kCLErrorDomain error 0.)",是因為模擬器設置不支持地理位置變化。 可以在模擬工具的菜單欄,Debug->Location->Freeway Device
2015-08-03
運行時一片黑的同學,請在Attributes inspector 下的 View Controller 勾選 Is Initial View Controller
2015-07-18