I did convert an image with:
UIImage *image = [UIImage imageNamed:"myImg.png"];
NSData *myData = UIImagePNGRepresentation(image);
//i had to convert it because I am sending it to the server
After receiving the NSData on the server side, I want now to display the image in a uiimageview
I did the following:
UIImage *convImg = [UIImage imageWithData:myData];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(160.5, 27, 40, 40)];
UIImage *bkgImg = [[UIImage alloc] initWithData:myData];
[imageView setImage:bkgImg];
[alert addSubview:imageView];
[alert show];
there is no image displayed. What am I doing wrong?