擅长:python、mysql、java
<blockquote>
<p>After implementing the refresh control I noticed that whenever I used to refresh, it used to append the new data in the array and created duplicity. I thought of a very simple solution which is that we can actually empty our array when refreshing so that we can avoid duplicity. </p>
</blockquote>
<p>当您刷新数据(pull to refresh)时,您应该清空<code>array</code>数据并用新数据填充它。你知道吗</p>
<blockquote>
<p>will we have any performance impact?</p>
</blockquote>
<p>如果你的意思是“分页”加载,你可能应该看看这个大问题。我个人非常喜欢<a href="https://dev.twitter.com/rest/public/timelines" rel="nofollow noreferrer">twitter's post</a>关于实施时间表。<br/>
另外,应该提到的是,屏幕上的显示数据没有问题,因为<code>reloadData()</code>函数只重新加载可见单元格。<code>reload/delete/insertRows</code>也不需要对UI进行如此繁重的操作。所以,实现它的唯一问题就是屏幕和数据库上数据的一致性。你知道吗</p>