Note that there are some explanatory texts on larger screens.

plurals
  1. POImage not showing in my UICollectionView
    primarykey
    data
    text
    <p>So I've been looking for a solution to this issue, but can't seem to find anything. I have an array that I load with image paths using the below method</p> <pre><code>- (IBAction)btnPictures:(id)sender { // Create the next view controller. ImageGalleryViewController *galleryViewController = [[ImageGalleryViewController alloc] initWithNibName:@"ImageGalleryViewController" bundle:nil]; // Search for paths and get users home directory NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); // get path at first index (in case multiple returned NSString *documentsDirectory = [paths objectAtIndex:0]; NSArray *dirContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:documentsDirectory error:nil]; NSArray *files = [dirContents filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"pathExtension IN %@", @"png"]]; // Pass the selected object to the new view controller. [galleryViewController setImageArray:files]; // Push the view controller. [self.navigationController pushViewController:galleryViewController animated:YES]; } </code></pre> <p>That image array is then sent to the below method in my UICollectionViewController</p> <pre><code>- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ ImageGalleryViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ImageGalleryViewCell" forIndexPath:indexPath]; NSLog(@"Image at index %@", [imageArray objectAtIndex:indexPath.row]); [cell.galleryImage setImage:[UIImage imageWithContentsOfFile:[imageArray objectAtIndex:indexPath.row]]]; [cell setBackgroundColor:[UIColor whiteColor]]; return cell; } </code></pre> <p>I verified the objectAtIndex is returning a valid image name through my NSLog, but for some reason the cell is not displaying it.</p> <p>Any help is greatly appreciated, thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    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.
    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