Skip to content

Instantly share code, notes, and snippets.

@mdobson
Last active December 18, 2015 15:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdobson/5807345 to your computer and use it in GitHub Desktop.
Save mdobson/5807345 to your computer and use it in GitHub Desktop.
create book in obj-c
UGClientResponse *response = [self.client createEntity:book];
//Lets check if our response was accepted by the server, and add the created object to a collection called _objects
if (response.transactionState == kUGClientResponseSuccess) {
[_objects insertObject:response.response[@"entities"][0] atIndex:0];
}
@mdobson
Copy link
Author

mdobson commented Jun 19, 2013

Here is how we create a book in objective c using UserGrid.

@smusa
Copy link

smusa commented Jun 21, 2013

Matt
I am getting entity missing a type field error from this section while trying to add new book entry
// the entity must have a "type" field
_type = [newEntity valueForKey:@"type"];
if ( !_type )
{
error = @"entity is missing a type field";
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment