54505

CloudKit Dashboard not updating

Question:

I'm making an app to store every users' comments and then dısplay them in my app. (just like a restaurant rating app) However when a user enters a comment and hits submit, nothing seems to appear on dashboard.

Every record type is set to queryable yet when I click on query results it gives me the error that I should set my indexes to queryable.

Here is my code.(Swift)

@IBAction func OnSubmitTouched(_ sender: UIButton) { if (textField.text != ""){ let newComment = CKRecord(recordType: "Comment") let publicDB = CKContainer.default().publicCloudDatabase newComment.setValue(textField.text!, forKey: "comment") CKContainer.default().fetchUserRecordID { recordID, error in guard let recordID = recordID, error == nil else { // error handling magic return } //let userID = CKContainer fetchUserRecordIDWithCompletionHandler: publicDB.save(newComment){ rec ,err in if let error = err { print(err.debugDescription) return } publicDB.fetch(withRecordID: recordID) { record, error in guard let record = record, error == nil else { // show off your error handling skills print(rec!["comment"]!) return } print("The user record is: \(record)") } } } let predicate = NSPredicate(value: true) let query = CKQuery(recordType: "Comment", predicate: predicate) let operation = CKQueryOperation(query: query) var commentRecords: [CKRecord] = [] operation.recordFetchedBlock = { record in commentRecords.append(record) } operation.queryCompletionBlock = { cursor, error in print(commentRecords) } CKContainer.default().publicCloudDatabase.add(operation)

Answer1:

Hmm... CloudKit is pretty good about telling you when a save failed. Are any of your errors returning anything?

Also, does CKContainer.default() return the same container ID as the one you're looking at in the dashboard?

The last thing I'd check is are you using the same Apple ID on the iOS device and the CloudKit dashboard so that you're looking at the same user's data?

Recommend

  • Make another controllers view a partial (Rails 3)
  • for loop iteration in django
  • Round number to nearest “nth” based on first non zero
  • M-RET behave differently in org mode 8.0.3
  • carrierwave Excon::Errors::SocketError
  • Check if windows explorer already opened on given path
  • php: best way to validate POST
  • Density Value for each Return
  • Client server multithread Socket
  • How can I join lazy translation in Django?
  • How to put different size vectors in data.table column
  • Drawing a Polygon
  • How to get rows with min values in one column, grouped by other column, while keeping other columns?
  • I want to trace logs using a Macro multi parameter always null. problem c++ windows
  • Putting text shadow on a UIButton text label
  • Form Authentication in Ktor
  • Failed to update work status Exception in Python Cloud Dataflow
  • Warning: ldap_start_tls() [function.ldap-start-tls]: Unable to start TLS: Server is unavailable
  • Get an index of a sorted matrix
  • Converting float[,] to list in f#?
  • Interpolation method that does not add unnecessary extremums
  • Mocking Non-Standard Events in F# Foq
  • mysql and indexes with more than one column
  • data.table replicate rows after join?
  • Get UILabel out of UIButton
  • Aligning image on right side of title on UIButton with imageEdgeInsets and titleEdgeInsets
  • How can we prepend rows to a react native list-view?
  • Click on button in another program - FindWindow, C#
  • c# open webrowser in many tab
  • How do I superscript characters in a UIButton?
  • How to Cache Real-time Data?
  • swift auto completion not working in Xcode6-Beta
  • MySQL WHERE-condition in procedure ignored
  • Web-crawler for facebook in python
  • AT Commands to Send SMS not working in Windows 8.1
  • trying to dynamically update Highchart column chart but series undefined
  • how does django model after text[] in postgresql [duplicate]
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • How can I remove ASP.NET Designer.cs files?
  • java string with new operator and a literal