阅读背景:

异步加载数据,但按顺序填充视图

来源:互联网 

I have a use case where I am loading some data using several datasources asynchronously. So, each datasource has a complete method and my view controller implements a protocol with that method defined. For ex, one of my datasources is fetchApples, which returns an array of Fruit objects to my controller and another datasource is fetchOranges etc. In my viewController, I want to have apples show up first, then oranges, then grapes (I populate a uiview with custom cells for rendering the fruits). If there are no apples, oranges should show up first etc. How can I map this order when my datasources are being returned asynchronously. ie. when oranges return, I dont know if i will have apples and thus I cannot populate the uiview with them yet?I have a use case where I am loading some data




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: