diff --git a/JBMessage.podspec b/JBMessage.podspec index 195e52f..d87c872 100644 --- a/JBMessage.podspec +++ b/JBMessage.podspec @@ -1,15 +1,15 @@ Pod::Spec.new do |s| s.name = "JBMessage" - s.version = "1.0.12" + s.version = "1.0.13" s.summary = "JBMessage is simple iOS networking wrapper based on AFNetworking" s.homepage = "https://github.com/josipbernat/JBMessage" s.license = { :type => "MIT", :file => "LICENSE" } s.author = { "Josip Bernat" => "josip.bernat@gmail.com" } s.social_media_url = "http://twitter.com/josipbernat" s.platform = :ios, "6.0" - s.source = { :git => "https://github.com/josipbernat/JBMessage.git", :tag => "v1.0.12" } + s.source = { :git => "https://github.com/josipbernat/JBMessage.git", :tag => "v1.0.13" } s.source_files = 'JBMessage/JBMessage/**/*.{h,m}' s.requires_arc = true - s.dependency "AFNetworking", "~> 2.3.1" + s.dependency "AFNetworking", "~> 2.3" end diff --git a/JBMessage/JBMessage/JBMessage.m b/JBMessage/JBMessage/JBMessage.m index a2df33f..89212b3 100644 --- a/JBMessage/JBMessage/JBMessage.m +++ b/JBMessage/JBMessage/JBMessage.m @@ -35,6 +35,8 @@ @interface JBMessage () { BOOL _isExecuting; } +@property (nonatomic, strong) AFHTTPRequestOperation *operation; + #pragma mark - Shared Queue + (NSOperationQueue *)sharedQueue; @@ -224,7 +226,10 @@ - (void) finish { } - (void) cancel { + _isCancelled = YES; + [self.operation cancel]; + self.operation = nil; } - (BOOL) isConcurrent { @@ -270,6 +275,8 @@ - (void)executeRequest { __strong JBMessage *strongThis = this; [strongThis receivedResponse:responseObject error:nil]; + strongThis.operation = nil; + } failure:^(AFHTTPRequestOperation *operation, NSError *error) { #ifdef DEBUG NSString *response = [[NSString alloc] initWithData:operation.responseData encoding:NSUTF8StringEncoding]; @@ -277,6 +284,7 @@ - (void)executeRequest { #endif __strong JBMessage *strongThis = this; [strongThis receivedResponse:operation.responseData error:error]; + strongThis.operation = nil; }]; [operation setUploadProgressBlock:self.uploadBlock]; diff --git a/Podfile b/Podfile index adace94..9e7a42f 100644 --- a/Podfile +++ b/Podfile @@ -1,2 +1,2 @@ platform :ios, '6.0' -pod 'AFNetworking', '~> 2.3.1' +pod 'AFNetworking', '~> 2.3' diff --git a/Podfile.lock b/Podfile.lock index 0a0c4d5..5199262 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -22,7 +22,7 @@ PODS: - AFNetworking/NSURLSession DEPENDENCIES: - - AFNetworking (~> 2.3.1) + - AFNetworking (~> 2.3) SPEC CHECKSUMS: AFNetworking: 6d7b76aa5d04c8c37daad3eef4b7e3f2a7620da3