Note that there are some explanatory texts on larger screens.

plurals
  1. POScroll Past UITableViewCell To See New Content
    text
    copied!<p><strong>How do I show a video automatically once it has downloaded, without having to scroll past a cell, and scroll back up to see it?</strong></p> <p>In a tableview, I have a series of AVPlayer videos.</p> <p>In each cell (the cellForRowAtIndexPath method), I have the following code to generate an asset for AVPlayer to play</p> <pre><code>AVURLAsset *asset = [AVURLAsset URLAssetWithURL:[self getURL:someURLString] options:nil]; </code></pre> <p><em>getURL</em></p> <ul> <li>if the video is stored locally, it returns the local url </li> <li>if the video is stored remotely, it downloads the video data to a local url, and then returns the local url</li> </ul> <p>The problem I am having is, that when the video is downloaded, I have to scroll past the cell, and then scroll back up again to see it. (When the video is already stored locally this does not happen)</p> <p>I have used methods like <code>setNeedsDisplay</code> and <code>reloadRowsAtIndexPath</code>. But they have not worked.</p> <p>Thanks for the help! :)</p> <hr> <p>Does a UITableViewCell for some reason stall during cellForRowAtIndexPath, in the sense that, when the local URL is returned, it attempts to reach an old version of local URL (before the cellForRowAtIndexPath was called)? (just a wild guess?)</p> <hr> <p>Temporary Solution:</p> <p><strong>Can you suggest a better way to download video (each video is only around 200KB) than in cellForRowAtIndexPath since this does not seem to be working?</strong></p>
 

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