ドキュメント通りでなぜエラーがでるのでしょうか?
Swift
1import UIKit 2import CoreLocation 3 4class LocationService:NSObject{ 5 6 override init() { 7 locationManager = CLLocationManager() //エラー:Use of unresolved identifier 'locationManager' 8 locationManager.desiredAccuracy = kCLLocationAccuracyKilometer 9 locationManager.requestWhenInUseAuthorization() 10 11 super.init() 12 locationManager.delegate = self 13 } 14 15} 16 17class ViewController: UIViewController { 18 19 override func viewDidLoad() { 20 super.viewDidLoad() 21 // Do any additional setup after loading the view, typically from a nib. 22 } 23 24 override func didReceiveMemoryWarning() { 25 super.didReceiveMemoryWarning() 26 // Dispose of any resources that can be recreated. 27 } 28 29 30}
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/05/26 02:27