来自iPhone的CloudKit(CloudKit from iPhone)

编程入门 行业动态 更新时间:2024-10-28 13:18:07
来自iPhone的CloudKit(CloudKit from iPhone)

试图从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

更多推荐

本文发布于:2023-07-05 06:49:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1034317.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:iPhone   CloudKit

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!