Created
March 27, 2014 18:55
-
-
Save Kevinwlee/9815294 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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