0

I have written a swift function to fetch data from cloudboost server. I am getting data with it. But I am not able to parse that data and general NSDictionary or NSArray form.

@IBAction func readData(sender: AnyObject) {
    let query = CloudQuery(tableName: "MyTable")
    try! query.find({ response in
        response.log();
    })
}

I am getting below respose for my query but I am not able to parse the data, can someone help me here?

Success? true
Status: Optional(200)
Message: nil
Object: Optional(<_TtCs21_SwiftDeferredNSArray 0x170035e60>(
CloudBoost.CloudObject,
CloudBoost.CloudObject,
CloudBoost.CloudObject,
CloudBoost.CloudObject,
CloudBoost.CloudObject,
CloudBoost.CloudObject,
CloudBoost.CloudObject,
CloudBoost.CloudObject,
CloudBoost.CloudObject,
CloudBoost.CloudObject
)
)

How to convert CloudBoost.CloudObject object to NSDictionary or NSArray to get my strings?

Pankaj Gaikar
  • 2,357
  • 1
  • 23
  • 29
  • Have you taken a look at their [Documentation](https://tutorials.cloudboost.io/en/datastorage/objects) ? It appears to me if there is a `setMethod` for objects, there must be a `getMethod` as well – NSNoob Aug 01 '16 at 07:23
  • I have tried using Fetch API but it returns error "Object does not have an ID, cannot fetch" which does not make any sense cz I have created neat and clean database. That is why I was trying to use query. – Pankaj Gaikar Aug 01 '16 at 07:43

0 Answers0