我有时在运行我的应用程序时在Xcode 8b3的日志中收到此消息,一切似乎都有效,但我想知道它来自何处.谷歌根本没有帮助.
我收到此错误消息:
2017-01-02 15:29:07.886534 TimeStamp [665:191103] [LogMessageLogging] 6.1无法检索CarrierName.CTError:domain-2,code-5,errStr:((os/kern)失败)
我想要每隔一分钟让应用程序更新我的位置到服务器.
我还在plist上设置了这两个键:
Privacy - Location Always Usage Description
Privacy - Location When In Use Usage Description
Run Code Online (Sandbox Code Playgroud)
并在"capibilities"中启用"后台模式","位置更新"
我用谷歌搜索,发现很多人在将Xcode更新为8.1后遇到了这个问题.并且只有在使用MapKit时才会出现此问题.我想知道如何解决它?我是新手.我希望有人可以帮我解决这个问题.非常感谢.
import UIKit
import MapKit
import APScheduledLocationManager
import CoreLocation
class MapViewController: UIViewController, MKMapViewDelegate, APScheduledLocationManagerDelegate {
@IBOutlet weak var mapView: MKMapView!
var manager: APScheduledLocationManager!
let radius = 1000.0
let locations = [
["title": "New York, NY", "latitude": 40.713054, "longitude": -74.007228, "image": UIImage(named: "tram")?.resizeImage(newWidth: 40) as Any],
["title": "Los Angeles, CA", "latitude": 34.052238, "longitude": -118.243344, "image": UIImage(named: "dark")?.resizeImage(newWidth: …Run Code Online (Sandbox Code Playgroud)