Tuesday, May 17, 2016

Convert image to base64 Format


Hi Guys,

Recently I played with conversion of NSImage to base64 format so thought of sharing with you all.
Here you go..

NSData   *data = (NSData*)[self.myImageView.image TIFFRepresentation];

NSString *str    = [data base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];

Hope you like it :)