Knowledgebase: QB Assistance
How to create multiple related records with QuickBlox iOS SDK?
Posted by on 13 January 2014 02:16 PM

How to create multiple related records with QuickBlox iOS SDK?

In order to create relation between custom tables you can use parentID field. To understand how it works let’s look through the following example:

let’s say you have two entities - Movies and Comments.

Each comment has parentID = movieID.

If you delete this movie, all comments will be deleted as well.

To get related records you can just use extendedRequest param, like in the following sample:

NSMutableDictionary *getRequest = [NSMutableDictionary dictionary];
[getRequest setObject:@"31212412a1269123" forKey:@"_parent_id"];

[QBCustomObjects objectsWithClassName:@"Comment" extendedRequest:getRequest delegate:self];

(1 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments: