i have a method that receives a UIImage
I convert it to NSData
and make a request to post that Data, it works on iOS 6 but when i try on iOS 7, the image lose the transparent background.
this is what i have tried till now:
-(void)post:(UIImage *)firm name:
{
int x = 350;
NSData *imageData = UIImagePNGRepresentation(firm);
UIImage *image=[UIImage imageWithData:imageData];
UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, x, 40, 50)];
imageView.backgroundColor = [UIColor clearColor];
imageView.image = image;
NSData *imageData2 = [NSData dataWithData:UIImagePNGRepresentation(firm)];
UIImage *image2=[UIImage imageWithData:imageData2];
UIImageView *imageView2 = [[UIImageView alloc]initWithFrame:CGRectMake(160, x, 40, 50)];
imageView2.image = image2;
UIImageView *imageView3 = [[UIImageView alloc]initWithFrame:CGRectMake(110, x, 40, 50)];
imageView3.image = firm;
UIImage * img = [UIImage imageWithData:UIImagePNGRepresentation(image)];
UIImageView *imageView4 = [[UIImageView alloc]initWithFrame:CGRectMake(210, x, 40, 50)];
imageView4.image = img;
[self.view addSubview:imageView];
[self.view addSubview:imageView2];
[self.view addSubview:imageView3];
[self.view addSubview:imageView4];
on the the imageView3
i'm just showing it as i get it without background (till here i get it all fine) but when i convert to NSData
an then get it back to UIImage
it loses the transparency,
code running on iOS 7
Same code running on iOS 6 and below works perfect!!
i have created an example os my issue on Github example