Skip to content

Instantly share code, notes, and snippets.

@Kevinwlee
Created March 27, 2014 18:55
Show Gist options
  • Save Kevinwlee/9815294 to your computer and use it in GitHub Desktop.
Save Kevinwlee/9815294 to your computer and use it in GitHub Desktop.
NSData *imageData = UIImageJPEGRepresentation(profilePicture,.99);
NSString *fileName = @"ProfilePicture.png";
CCHVaultResource *profilePictureResource = [[CCHVaultResource alloc]initWithName:@"profile_picture_url"
fileName:fileName
mimeType:@"image/png"
data:imageData];
NSString *container = @"profiles";
NSDictionary *profileInfo = @{@"name" : @"Your Name",
@"nick_name":@"Bubba"};
[[CCHVaultService sharedService] createItem:profileInfo withResources:@[profilePictureResource] inContainer:container completion:^(NSDictionary *carbonResponse, NSError *error) {
if (error) {
NSLog(@"Error %@", error);
} else {
NSLog(@"Success %@", carbonResponse);
}
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment