Skip to content

Commit

Permalink
Fixed networking activity tip.
Browse files Browse the repository at this point in the history
  • Loading branch information
titman committed Jun 29, 2015
1 parent 6b781fc commit 6600ab9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LIKE/LIKE/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.0.8.2</string>
<string>1.0.8.3</string>
<key>FacebookAppID</key>
<string>368579790017819</string>
<key>FacebookDisplayName</key>
Expand Down
2 changes: 1 addition & 1 deletion LIKE/LIKE/LCFramework/Extension/ASI/ASIHTTPRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static void ReadStreamClientCallBack(CFReadStreamRef readStream, CFStreamEventTy
// You can use [ASIHTTPRequest setShouldUpdateNetworkActivityIndicator:NO] if you want to manage it yourself
// Alternatively, override showNetworkActivityIndicator / hideNetworkActivityIndicator
// By default this does nothing on Mac OS X, but again override the above methods for a different behaviour
static BOOL shouldUpdateNetworkActivityIndicator = YES;
static BOOL shouldUpdateNetworkActivityIndicator = NO;

// The thread all requests will run on
// Hangs around forever, but will be blocked unless there are requests underway
Expand Down
8 changes: 8 additions & 0 deletions LIKE/LIKE/LCFramework/Network/LCNetworkCenter.m
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ -(void) cancelRequestsWithObject:(NSObject *)object

if ([task._TagString_ isEqualToString:p]) {

[self postNotification:AFNetworkingTaskDidCompleteNotification withObject:task];
[task cancel];
}
}
Expand Down Expand Up @@ -267,6 +268,10 @@ -(void) removeTask:(NSURLSessionDataTask *)task withSender:(NSObject *)sender

-(void) handleSuccessTask:(NSURLSessionDataTask *)task responseOjbect:(id)responseObject updateBlock:(LCNetworkCenterBlock)updateBlock sender:(NSObject *)sender
{

[self postNotification:AFNetworkingTaskDidCompleteNotification withObject:task];


LCHTTPRequestResult * result = [[LCHTTPRequestResult alloc] init];
result.responseObject = responseObject;
result.task = task;
Expand All @@ -284,6 +289,9 @@ -(void) handleFailureTask:(NSURLSessionDataTask *)task
error:(NSError *)error
updateBlock:(LCNetworkCenterBlock)updateBlock sender:(NSObject *)sender
{
[self postNotification:AFNetworkingTaskDidCompleteNotification withObject:task];


LCHTTPRequestResult * result = [[LCHTTPRequestResult alloc] init];

NSDictionary * userInfo = [NSDictionary dictionaryWithObject:LC_LO(@"请求失败...请检查您的网络后重试") forKey:NSLocalizedDescriptionKey];
Expand Down

0 comments on commit 6600ab9

Please sign in to comment.