http://www.cnblogs.com/machao/p/5681645.html
我們?cè)诳匆粋€(gè)框架的時(shí)候呢,可以這樣先看,先看每個(gè)文件的頭文件,也就是.h文件
比較獨(dú)立的類有:
1.AFURLResponseSerialization.h(處理響應(yīng))
2.AFNetworkReachabilityManager.h(網(wǎng)絡(luò)監(jiān)聽(tīng))
3.AFURLRequestSerialization.h(發(fā)送請(qǐng)求)
4.AFSecurityPolicy.h(設(shè)置請(qǐng)求頭)
http://blog.csdn.net/deft_mkjing/article/details/51900737
- 鍵值依賴
- 網(wǎng)絡(luò)狀態(tài)監(jiān)聽(tīng)器(用于 對(duì)刷新的 判斷)
@property (nonatomic, strong) AFNetworkReachabilityManager *reachabilityManager;
//上拉加載數(shù)據(jù)
- (void)loadData {
//設(shè)置上拉加載
__weak typeof(self) weakSelf = self;
self.refreshFooter = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
__strong typeof(self) strongSelf = weakSelf;
if (strongSelf) {
if (!_reachabilityManager.isReachable) {
//沒(méi)有網(wǎng)絡(luò),停止加載
[strongSelf.refreshFooter endRefreshing];
[MBProgressHUD myi_promptHudWithShowHUDAddedTo:self.view message:@"網(wǎng)絡(luò)連接失??!"];
return;
}
[strongSelf loadData:_maxgid provinceId:_provinceId cityId:_cityId areaId:_areaId];
}
}];
[self.refreshFooter setTitle:@"加載更多 ..." forState:MJRefreshStateRefreshing];
[self.refreshFooter setTitle:@"沒(méi)有更多內(nèi)容了" forState:MJRefreshStateNoMoreData];
self.tableView.mj_footer = self.refreshFooter;
}