需求:
1、有數(shù)據(jù)情況下 每次上拉加載會請求n+1頁數(shù)據(jù)(每頁數(shù)據(jù)多少由后臺決定一般20條) ?
2、無數(shù)據(jù)情況下不會請求下一頁 ?
3、首次請求無數(shù)據(jù)時顯示無數(shù)據(jù)視圖(或測試數(shù)據(jù))
實現(xiàn)邏輯:
MJRefresh框架 #import“MJRefresh.h"
數(shù)據(jù)源(NSMutableArray)dataSource
數(shù)據(jù)頁數(shù)(NSInteger)begin_pos
下一頁無數(shù)據(jù)(BOOL)hasMoreData
1、視圖加載進(jìn)行首次且唯一數(shù)據(jù)請求

//3、有數(shù)據(jù)(根據(jù)hasMoreData標(biāo)簽決定是否進(jìn)行下次請求hasMoreData=YES請求hasMoreData=NO結(jié)束刷新)

//2、有數(shù)據(jù)(a.置hasMoreData為YES ?b.把數(shù)據(jù)加入數(shù)據(jù)源) ?無數(shù)據(jù)(a.置hasMoreData為NO,如果是首次且唯一那么數(shù)據(jù)無數(shù)據(jù)視圖(或測試數(shù)據(jù)))
