Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloudkit error when querying public database from simulator

I'm working on an app where I recently decided to go with CloudKit and am now at the point where I need to implement the backend functionality. In a nutshell, this app will use a collectionview to display images retrieved from a CK database. Up until now, I just dumped some images in a folder on my desktop and retrieved/parsed the images from there to render the collectionview. I then used the CK dashboard to create some records and wrote an initialization method to try and retrieve them. I was getting various CKErrors, such as network failure, error completion without receiving a response from the server, could not send a valid signature, etc. I immediately assumed the issue was with my code since it was my first attempt with CloudKit. However, I ran the latest code on my device before posting on SO and it worked! I got a successful response with the number of records in the results array that I was expecting.

So now I know longer need help with fetching CKRecords like I initially thought. But how do I resolve this issue with the simulator? I saw some other post about making sure you're signed into iCloud on the simulator. I believe I am, but do not know how to check to be sure. Also, I'm running Yosemite and Xcode 6.1.

Any help is appreciated!

like image 949
SonnyB Avatar asked Oct 24 '14 16:10

SonnyB


2 Answers

on the simulator go to the settings app. You can do that with menu hardware, home and then open the settings app, select iCloud and make sure that you are logged in.

like image 137
Edwin Vermeer Avatar answered Sep 17 '22 12:09

Edwin Vermeer


To use your Apple ID on iCloud on the iPhone Simulator, make sure you turn off Two-way authentication. It should then work on the simulator.

like image 35
Wei-Meng Lee Avatar answered Sep 18 '22 12:09

Wei-Meng Lee