Note that there are some explanatory texts on larger screens.

plurals
  1. POUICollectionView doesn't update immediately when calling reloadData, but randomly after 30-60 seconds
    text
    copied!<p>As the title implies, my <code>UICollectionView</code> doesn't update and display the cells immediately after calling <code>reloadData</code>. Instead, it seems to eventually update my collection view after 30-60 seconds. My setup is as follows:</p> <p><code>UICollectionView</code> added to view controller in Storyboard with both <code>delegate</code> and <code>dataSource</code> setup for the view controller and standard outlet setup <code>numberOfSectionsInRow</code> &amp; <code>cellForItemAtIndexPath</code> are both implemented and reference the prototyped cell and the <code>imageView</code> inside of it</p> <p>Here is the code that goes to Twitter, get's a timeline, assigns it to a variable, reloads a table view with the tweets and then goes through the tweets to find photos and reloads the collection view with those items.</p> <p>Even if I comment out the code to display the image, it still doesn't change anything.</p> <pre><code>SLRequest *timelineRequest = [SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:SLRequestMethodGET URL:timelineURL parameters:timelineParams]; [timelineRequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) { if(responseData) { JSONDecoder *decoder = [[JSONDecoder alloc] init]; NSArray *timeline = [decoder objectWithData:responseData]; [self setTwitterTableData:timeline]; for(NSDictionary *tweet in [self twitterTableData]) { if(![tweet valueForKeyPath:@"entities.media"]) { continue; } for(NSDictionary *photo in [[tweet objectForKey:@"entities"] objectForKey:@"media"]) { [[self photoStreamArray] addObject:[NSDictionary dictionaryWithObjectsAndKeys: [photo objectForKey:@"media_url"], @"url", [NSValue valueWithCGSize:CGSizeMake([[photo valueForKeyPath:@"sizes.large.w"] floatValue], [[photo valueForKeyPath:@"sizes.large.h"] floatValue])], @"size" , nil]]; } } [[self photoStreamCollectionView] reloadData]; } }]; </code></pre>
 

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