为解决iOS手机程序在请求数据时处理不当出现的黑屏现象和请求等待时间长的问题,针对常用的ASIHTTPRequest同步方法和ASIHTTPRequest异步方法存在的不足,提出Block模式和ASIHTTPRequest异步请求相结合的方法,该方法在加速请求的同时让用户在获取数据的等待过程中,在当前页面出现等待指示器的旋转小图标,提高用户体验度。最后通过实验证明Block和ASIHTTPRequest异步相结合的方法与其他方法相比,在获取相同数据量的时候,所用的时间最少,而且随着数据量的增加,优势更加明显。
To solve the iOS mobile application blank screen phenomenon and waiting a long time when request, for commonly used methods of synchronous and asynchronous ASIHTTPRequest methods existing problems, propose Block and ASIHTTPRequest asynchronous method combining, this method can increases speed, and waiting indicator rotation icon appears on the current page when waiting for network data, improving user experience. Finally, experimental results show that in obtaining the same amount of data, Block and ASIHTTPRequest asynchronous methods needing least amount of time, and with the amount of data increasing, the advantages are more obvious.