【发布时间】:2014-08-06 19:21:37
【问题描述】:
我的视图控制器上有这段代码,但这不起作用:
import UIKit
import CoreLocation
class ViewController: UIViewController, CLLocationManagerDelegate {
var location: CLLocationManager!
override func viewDidLoad() {
super.viewDidLoad()
location=CLLocationManager()
location.delegate = self
location.desiredAccuracy=kCLLocationAccuracyBest
location.startUpdatingLocation()
}
func locationManager(location:CLLocationManager, didUpdateLocations locations:AnyObject[]) {
println("locations = \(locations)")
label1.text = "success"
}
我拥有在其他帖子中阅读的权限。但我没有得到 never,没有 println..
谢谢!!
【问题讨论】:
-
这对我有用它是一个简单的例子见:stackoverflow.com/a/35973586/3410437
标签: ios swift core-location cllocationmanager