Commit 52337ac2 authored by 李震's avatar 李震

Merge branch 'lz/gmBase' into 'master'

Lz/gm base

See merge request !14
parents e6b12e14 36314bc2
......@@ -318,7 +318,7 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-GMBase_Example/Pods-GMBase_Example-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-GMBase_Example/Pods-GMBase_Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework",
"${BUILT_PRODUCTS_DIR}/GMBase/GMBase.framework",
"${BUILT_PRODUCTS_DIR}/GMCache/GMCache.framework",
......@@ -353,7 +353,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-GMBase_Example/Pods-GMBase_Example-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-GMBase_Example/Pods-GMBase_Example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
6B1A34007915B07651D26E10 /* [CP] Check Pods Manifest.lock */ = {
......
......@@ -14,7 +14,7 @@ PODS:
- AFNetworking/Serialization (3.1.0)
- AFNetworking/UIKit (3.1.0):
- AFNetworking/NSURLSession
- GMBase (0.5.0):
- GMBase (1.0.1):
- GMHud
- GMJSONModel
- GMKit
......@@ -103,7 +103,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
GMBase: c2d6cee8062f0230844e10f089e81769ff901f87
GMBase: cb450491a520db00d02dc2c35c753e4011f06134
GMCache: b7d48432ee2469eb0c6c86c720a1958bd373187e
GMHud: 9cc3942fc9f215db55b134cbfd05a458b124a964
GMJSONModel: 5e81a98de668e9f93cf6ff77869f77b0d1a806be
......@@ -119,4 +119,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: b9c24bb8fb1ea50b58c59e079b456b4ca1d9b998
COCOAPODS: 1.5.3
COCOAPODS: 1.6.0.beta.2
......@@ -136,7 +136,6 @@
- (void)refreshList{
[self.viewModel setStartNum:0];
[self.viewModel setPage:1];
[[self.viewModel dataArray] removeAllObjects];
[_collectionView reloadData];
......
......@@ -94,7 +94,6 @@
- (void)refreshList{
[self.viewModel setStartNum:0];
[self.viewModel setPage:1];
[[self.viewModel dataArray] removeAllObjects];
[_table reloadData];
......
......@@ -98,9 +98,6 @@
/** @brief 获取http数据分页第一页起始位置,默认为0,下一页为startNum+每页的数据条数(默认为10) */
@property (nonatomic,assign) NSInteger startNum;
/** @brief 获取http数据,按照页码进行获取(默认为1) */
@property (nonatomic,assign) NSInteger page;
/** @brief 获取http数据,每页获取数据(默认为10) */
@property (nonatomic,assign) NSInteger count;
......
......@@ -20,7 +20,6 @@
_dataArray = [[NSMutableArray alloc] init];
_startNum = 0;
_params = nil;
_page = 1;
_count = 10;
_deduplicationDic = [NSMutableDictionary dictionary];
_fetchDataErrorMsg = @"获取数据失败,请重试";
......@@ -42,7 +41,7 @@
}
- (BOOL)shouldClearDataForResponse:(id)response{
return self.startNum == 0 && self.page == 1;
return self.startNum == 0;
}
- (void)fetchRemoteData{
......@@ -67,7 +66,6 @@
NSArray *array = (NSArray *)responseObject;
[self buildModelWithRemoteArray:array];
self.page++;
[self setValue:@YES forKey:@"fetchDataSuccess"];
}else if([responseObject isKindOfClass:[NSDictionary class]]){
......@@ -76,12 +74,10 @@
self.message = responseObject[@"message"];
if (code == APIStatusCodeSuccess) {
[self buildModelWithRemoteDic:dic];
self.page++;
[self setValue:@YES forKey:@"fetchDataSuccess"];
}else if (code == APIStatusCodeEmpty){
self.message = responseObject[@"message"];
self.page++;
[self setValue:@YES forKey:@"fetchDataSuccess"];
}else{
......@@ -104,7 +100,6 @@
// 因为 clearData 可能会被外部调用,所以 self.startNum = 0 要确认执行,不能少
self.startNum = 0;
_deleteCount = 0;
self.page = 1;
[self.dataArray removeAllObjects];
[_deduplicationDic removeAllObjects];
}
......@@ -112,7 +107,6 @@
- (void)handleHeaderRefreshing
{
self.startNum = 0;
self.page = 1;
[self fetchRemoteData];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment