Note that there are some explanatory texts on larger screens.

plurals
  1. POUIImageView with iOS 7 not showing up
    primarykey
    data
    text
    <p>I have an app I was building for iOS 6 that I recently upgraded to iOS 7. I have a <code>UIScrollView</code> with a few Custom <code>UIViews</code>. Within those <code>UIViews</code>, I have a single <code>UIImageView</code> in each. For some reason, when I set the <code>UIImageView.image</code> in iOS 6, it shows up fine, but iOS 7 will not show them. Here's the code:</p> <pre><code>int i = 0; for (UIImageView *imageView in myImageViewsOutletCollection) { imageView.image = nil; if (imagesArray.count &gt; i) imageView.image = [UIImage imageWithData:[imagesArray objectAtIndex:i]]; if (imageView.image == nil) NSLog(@"signature image with index: %i is nil", i); else NSLog(@"It Worked") i++; } </code></pre> <p>My app is logging: <code>@"It Worked"</code>, so I know the <code>UIImageView.image</code> isn't <code>nil</code>. What could I be doing wrong?</p> <p>EDIT:</p> <p>I tried the UIImageRenderingMode:</p> <pre><code>UIImage *imageForView = [UIImage imageWithData:[imagesArray objectAtIndex:i]]; imageForView = [imageForView imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; imageView.image = imageForView; </code></pre> <p>Still didn't work. However, @Max_Power89 said:</p> <blockquote> <p>as it is written on the apple developer forum : imageWithData bug report</p> <p>this must be a bug. i hope they fix the problem early.</p> </blockquote> <p>EDIT 2:</p> <p>I also added this:</p> <pre><code>NSData *pngData = UIImagePNGRepresentation(imageView.image); NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES); NSString *docs = [paths objectAtIndex:0]; NSError *writeError = nil; [pngData writeToFile:[docs stringByAppendingFormat:@"/image.png"] options:NSDataWritingAtomic error:&amp;writeError]; if(writeError!=nil) { NSLog(@"%@: Error saving image: %@", [self class], [writeError localizedDescription]); } </code></pre> <p>The image was saved in app's directory, so I know for certain that the image isn't nil.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload