我添加的代碼在我的ios healthkit斯威夫特的應用程序,但我發現了一個錯誤......如何用healthkit解決這個錯誤?
/* Ask for permission to access the health store */
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
if HKHealthStore.isHealthDataAvailable(){
healthStore.requestAuthorizationToShareTypes(typesToShare,
readTypes: typesToRead,
completion: {(succeeded: Bool, error: NSError!) in
if succeeded && error == nil{
println("Successfully received authorization")
} else {
if let theError = error{
println("Error occurred = \(theError)")
}
}
})
} else {
println("Health data is not available")
}
}
時發生錯誤=錯誤域= com.apple.healthkit代碼= 4「缺少 com.apple.developer.healthkit權利「。的UserInfo = 0x7fa748534b00 {NSLocalizedDescription =缺少com.apple.developer.healthkit 權利。}
怎樣才能解決這個問題?
謝謝!
鑑於該錯誤是,你錯過的健康權利套件,我們可以假設你已經嘗試通過將健康進行修復套件權利? – 2014-09-23 22:46:02