這裏我要轉換的圖像代碼,Base64編碼轉換問題
CGSize newSize1=CGSizeMake(720.00, 576);
self.imageData = [PDFImageConverter convertImageToPDF:image1 withResolution:300 maxBoundsRect:CGRectMake(0, 0, 194, 154) pageSize:newSize1];
largerbtn.selected=YES;
smallerbtn.selected=NO;
CGSize newSize=CGSizeMake(194, 154);
UIGraphicsBeginImageContext(newSize);
[image1 drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
//NSData *imageData1
imageData1=UIImageJPEGRepresentation(newImage, 1.0);
//NSString *encodedString
encodedString= [Base64 encode:imageData1];//crashed when it reached here
NSLog(@"%@",encodedString);
的應用,當它到達的base64相互轉換,有什麼毛病我code.Please幫我解決這個問題得到墜毀。
檢查之前'imageData1'是零,試圖編碼 –
@ LithuT.V我當它不是零。它顯示'NSShadow {0,0} color = {UIDeviceRGBColorSpace 0.5 0.5 0.5 1}' – Fazil
你正在使用哪個類進行編碼? –