试图从CloudKit获取一些数据,我有一些奇怪的问题; 如果我通过iPhone 5的模拟器运行代码一切正常,但所有其他设备获取数据时出错。 如果我将iPhone 6连接到计算机并在那里运行它,它可以正常工作。 如果我通过TestFlight测试它,它在iPhone 4s,iPhone 5或iPhone 6上不起作用。
let cloudContainer = CKContainer.defaultContainer() let publicDatabase = CKContainer.defaultContainer().publicCloudDatabase let predicate = NSPredicate(value: true) let query = CKQuery(recordType: "Employee", predicate: predicate) publicDatabase.performQuery(query, inZoneWithID: nil, completionHandler: { results, error in if error == nil { //some code } else { println(error) }})错误:
did not find required record type.我已经检查了CloudKit仪表板中的所有记录类型,数据等,并记住它在iPhone 5模拟器中工作正常(如果我在CloudKit Dashborad中添加/删除数据,它会反映在应用程序中)。
任何帮助表示赞赏。
Trying to fetch some data from CloudKit, and I have some strange problem; If I run the code through the simulator for iPhone 5 everything works fine, but all other devices get an error fetching data. If I connect my iPhone 6 to the computer and run it there, it works fine. If I test it through TestFlight it doesn't work on iPhone 4s, iPhone 5 or iPhone 6.
let cloudContainer = CKContainer.defaultContainer() let publicDatabase = CKContainer.defaultContainer().publicCloudDatabase let predicate = NSPredicate(value: true) let query = CKQuery(recordType: "Employee", predicate: predicate) publicDatabase.performQuery(query, inZoneWithID: nil, completionHandler: { results, error in if error == nil { //some code } else { println(error) }})Error:
did not find required record type.I have checked all records type, data and so in CloudKit Dashboard, and remember it workes fine in the iPhone 5 simulator (if I add/delete data in CloudKit Dashborad, it reflects in the app).
Any help is appreciated.
最满意答案
您需要将Development CloudKit Environment部署到Production one。 检查icloud.developer.apple.com中的“部署”选项卡
You need to deploy your Development CloudKit Environment to Production one. Check Deployment tab in icloud.developer.apple.com
更多推荐
发布评论