joffd joffd - 1 year ago 62
iOS Question

Using Kii Query Result

I am running a Kii Query that returns the expected number of results. However the results array contains object formatted as follow

"<KiiObject: 0x130471ae0>"

this is the output from


I am confident that the Query is working correctly as i can add and remove objects from the bucket and the number of results in the array changes according, i just don't know how to take the results and get the corresponding object.

I have gone over everything in the Kii Doc's

link to Kii Docs

The result is to short to be the object id(uuid string) and i can't find any other reference in the docs that makes sense.

Answer Source

You can refer to bellow snippet

NSError *error = nil;

// Build "all" query
KiiQuery *allQuery = [KiiQuery queryWithClause:nil];

// Create an array to store all the results in
NSMutableArray *allResults = [NSMutableArray array];

// Create a placeholder for any paginated queries
KiiQuery *nextQuery;

// Get an array of KiiObjects by querying the bucket
NSArray *results = [bucket executeQuerySynchronous:allQuery
if (error != nil) {
  // Error handling
//obtain single KiiObject
KiiObject* firstObject = allResults.firstObject; // now you should get all the object properties 
NSLog(@"MaxScore : %@",[firstObject getObjectForKey:@"maxScore"]); //i.e to get "maxScore" value

Below is the links for querying KiiObjects.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download