How to convert UIimage
to base64 encoded string? I couldn\'t find any examples or codes with detailed regarding.
when converting to image to base64 in ios the new line “\n” from base64 encoded strings :
use this code :
UIImage* orginalImage = [info objectForKey:UIImagePickerControllerOriginalImage]; NSIndexPath *indexPath = [NSIndexPath indexPathForRow:isRowIndex inSection:isSectionIndex] ; UITableViewCell *cell = [jobstable cellForRowAtIndexPath:indexPath]; UIImageView *tableIMAGE=(UIImageView *)[cell.contentView viewWithTag:19]; tableIMAGE.image=orginalImage; imageStris = [UIImageJPEGRepresentation(tableIMAGE.image,1)base64Encoding]; answersARRAY[indexPath.row] = [NSString stringWithFormat:@"-1,%@,%@",answersARRAY[indexPath.row],imageStris]; [self dismissViewControllerAnimated:YES completion:nil];