Start a conversation

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];

Choose files or drag and drop files
Was this article helpful?
  1. Maksym Pidhorbunskyi

  2. Posted
  3. Updated