From 5da4aceb03e618420d1c3ed7014f856a5d8bdf24 Mon Sep 17 00:00:00 2001 From: Zhao Yiqi Date: Sat, 30 Nov 2013 03:56:02 +0800 Subject: [PATCH 1/6] Fix memory leak in IOS7 --- Classes/ASIInputStream.h | 8 +- Classes/ASIInputStream.m | 244 +++++++++++++++++++++++++++++++-------- 2 files changed, 198 insertions(+), 54 deletions(-) diff --git a/Classes/ASIInputStream.h b/Classes/ASIInputStream.h index 7b9f93ed..e3d579ef 100644 --- a/Classes/ASIInputStream.h +++ b/Classes/ASIInputStream.h @@ -14,13 +14,11 @@ // Subclassing NSInputStream seems to be tricky, and may involve overriding undocumented methods, so we'll cheat instead. // It is used by ASIHTTPRequest whenever we have a request body, and handles measuring and throttling the bandwidth used for uploading -@interface ASIInputStream : NSObject { - NSInputStream *stream; - ASIHTTPRequest *request; -} +@interface ASIInputStream : NSObject + + (id)inputStreamWithFileAtPath:(NSString *)path request:(ASIHTTPRequest *)request; + (id)inputStreamWithData:(NSData *)data request:(ASIHTTPRequest *)request; +- (id)initWithInputStream:(NSInputStream *)stream; -@property (retain, nonatomic) NSInputStream *stream; @property (assign, nonatomic) ASIHTTPRequest *request; @end diff --git a/Classes/ASIInputStream.m b/Classes/ASIInputStream.m index d2b84288..ccbcbcb4 100644 --- a/Classes/ASIInputStream.m +++ b/Classes/ASIInputStream.m @@ -8,68 +8,67 @@ #import "ASIInputStream.h" #import "ASIHTTPRequest.h" +#import // Used to ensure only one request can read data at once static NSLock *readLock = nil; @implementation ASIInputStream +{ + NSInputStream *stream; + id delegate; + + CFReadStreamClientCallBack copiedCallback; + CFStreamClientContext copiedContext; + CFOptionFlags requestedEvents; + ASIHTTPRequest *request; +} + (void)initialize { - if (self == [ASIInputStream class]) { - readLock = [[NSLock alloc] init]; - } + if (self == [ASIInputStream class]) { + readLock = [[NSLock alloc] init]; + } } + (id)inputStreamWithFileAtPath:(NSString *)path request:(ASIHTTPRequest *)theRequest { - ASIInputStream *theStream = [[[self alloc] init] autorelease]; - [theStream setRequest:theRequest]; - [theStream setStream:[NSInputStream inputStreamWithFileAtPath:path]]; - return theStream; + ASIInputStream *theStream = [[[ASIInputStream alloc] initWithInputStream:[NSInputStream inputStreamWithFileAtPath:path]] autorelease]; + [theStream setRequest:theRequest]; + return theStream; } + (id)inputStreamWithData:(NSData *)data request:(ASIHTTPRequest *)theRequest { - ASIInputStream *theStream = [[[self alloc] init] autorelease]; - [theStream setRequest:theRequest]; - [theStream setStream:[NSInputStream inputStreamWithData:data]]; - return theStream; + ASIInputStream *theStream = [[[ASIInputStream alloc] initWithInputStream:[NSInputStream inputStreamWithData:data]] autorelease]; + [theStream setRequest:theRequest]; + return theStream; } -- (void)dealloc +#pragma mark - Object lifecycle + +- (id)initWithInputStream:(NSInputStream *)aStream { - [stream release]; - [super dealloc]; + self = [super init]; + if (self) { + // Initialization code here. + stream = [aStream retain]; + [stream setDelegate:self]; + + [self setDelegate:self]; + } + + return self; } -// Called when CFNetwork wants to read more of our request body -// When throttling is on, we ask ASIHTTPRequest for the maximum amount of data we can read -- (NSInteger)read:(uint8_t *)buffer maxLength:(NSUInteger)len +- (void)dealloc { - [readLock lock]; - unsigned long toRead = len; - if ([ASIHTTPRequest isBandwidthThrottled]) { - toRead = [ASIHTTPRequest maxUploadReadLength]; - if (toRead > len) { - toRead = len; - } else if (toRead == 0) { - toRead = 1; - } - [request performThrottling]; - } - [readLock unlock]; - NSInteger rv = [stream read:buffer maxLength:toRead]; - if (rv > 0) - [ASIHTTPRequest incrementBandwidthUsedInLastSecond:rv]; - return rv; -} - -/* - * Implement NSInputStream mandatory methods to make sure they are implemented - * (necessary for MacRuby for example) and avoid the overhead of method - * forwarding for these common methods. - */ + [stream release]; + [super dealloc]; +} + +#pragma mark - NSStream subclass methods + - (void)open { [stream open]; @@ -80,14 +79,19 @@ - (void)close [stream close]; } -- (id)delegate +- (id )delegate { - return [stream delegate]; + return delegate; } -- (void)setDelegate:(id)delegate +- (void)setDelegate:(id)aDelegate { - [stream setDelegate:delegate]; + if (aDelegate == nil) { + delegate = self; + } + else { + delegate = aDelegate; + } } - (void)scheduleInRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode @@ -120,19 +124,161 @@ - (NSError *)streamError return [stream streamError]; } +#pragma mark - NSInputStream subclass methods + +// Called when CFNetwork wants to read more of our request body +// When throttling is on, we ask ASIHTTPRequest for the maximum amount of data we can read +- (NSInteger)read:(uint8_t *)buffer maxLength:(NSUInteger)len +{ + [readLock lock]; + unsigned long toRead = len; + if ([ASIHTTPRequest isBandwidthThrottled]) { + toRead = [ASIHTTPRequest maxUploadReadLength]; + if (toRead > len) { + toRead = len; + } else if (toRead == 0) { + toRead = 1; + } + [request performThrottling]; + } + [readLock unlock]; + NSInteger rv = [stream read:buffer maxLength:toRead]; + if (rv > 0) + [ASIHTTPRequest incrementBandwidthUsedInLastSecond:rv]; + return rv; +} + + +- (BOOL)getBuffer:(uint8_t **)buffer length:(NSUInteger *)len +{ + // We cannot implement our character-counting in O(1) time, + // so we return NO as indicated in the NSInputStream + // documentation. + return NO; +} + +- (BOOL)hasBytesAvailable +{ + return [stream hasBytesAvailable]; +} + +#pragma mark - Undocumented CFReadStream bridged methods + ++ (BOOL)resolveInstanceMethod:(SEL) selector +{ + NSString *name = NSStringFromSelector(selector); + + if ([name hasPrefix:@"_"]){ + name = [name substringFromIndex:1]; + SEL aSelector = NSSelectorFromString(name); + Method method = class_getInstanceMethod(self, aSelector); + + if (method) + { + class_addMethod(self, + selector, + method_getImplementation(method), + method_getTypeEncoding(method)); + return YES; + } + } + return [super resolveInstanceMethod:selector]; +} + +- (void)scheduleInCFRunLoop:(CFRunLoopRef)aRunLoop forMode:(CFStringRef)aMode +{ + CFReadStreamScheduleWithRunLoop((CFReadStreamRef)stream, aRunLoop, aMode); +} + +- (BOOL)setCFClientFlags:(CFOptionFlags)inFlags callback:(CFReadStreamClientCallBack)inCallback context:(CFStreamClientContext *)inContext +{ + if (inCallback != NULL) { + requestedEvents = inFlags; + copiedCallback = inCallback; + memcpy(&copiedContext, inContext, sizeof(CFStreamClientContext)); + + if (copiedContext.info && copiedContext.retain) { + copiedContext.retain(copiedContext.info); + } + } + else { + requestedEvents = kCFStreamEventNone; + copiedCallback = NULL; + if (copiedContext.info && copiedContext.release) { + copiedContext.release(copiedContext.info); + } + + memset(&copiedContext, 0, sizeof(CFStreamClientContext)); + } + + return YES; +} + +- (void)unscheduleFromCFRunLoop:(CFRunLoopRef)aRunLoop forMode:(CFStringRef)aMode +{ + CFReadStreamUnscheduleFromRunLoop((CFReadStreamRef)stream, aRunLoop, aMode); +} + +#pragma mark - NSStreamDelegate methods + +- (void)stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode +{ + assert(aStream == stream); + + switch (eventCode) { + case NSStreamEventOpenCompleted: + if (requestedEvents & kCFStreamEventOpenCompleted) { + copiedCallback((CFReadStreamRef)self, + kCFStreamEventOpenCompleted, + copiedContext.info); + } + break; + + case NSStreamEventHasBytesAvailable: + if (requestedEvents & kCFStreamEventHasBytesAvailable) { + copiedCallback((CFReadStreamRef)self, + kCFStreamEventHasBytesAvailable, + copiedContext.info); + } + break; + + case NSStreamEventErrorOccurred: + if (requestedEvents & kCFStreamEventErrorOccurred) { + copiedCallback((CFReadStreamRef)self, + kCFStreamEventErrorOccurred, + copiedContext.info); + } + break; + + case NSStreamEventEndEncountered: + if (requestedEvents & kCFStreamEventEndEncountered) { + copiedCallback((CFReadStreamRef)self, + kCFStreamEventEndEncountered, + copiedContext.info); + } + break; + + case NSStreamEventHasSpaceAvailable: + // This doesn't make sense for a read stream + break; + + default: + break; + } +} + // If we get asked to perform a method we don't have (probably internal ones), // we'll just forward the message to our stream - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector { - return [stream methodSignatureForSelector:aSelector]; + return [stream methodSignatureForSelector:aSelector]; } - + - (void)forwardInvocation:(NSInvocation *)anInvocation { - [anInvocation invokeWithTarget:stream]; + [anInvocation invokeWithTarget:stream]; } -@synthesize stream; @synthesize request; -@end +@end \ No newline at end of file From 85341aadc199c50eb5aeb34eb8fe68d54fdafc07 Mon Sep 17 00:00:00 2001 From: heroims Date: Tue, 3 Dec 2013 11:07:08 +0800 Subject: [PATCH 2/6] Merge branch 'master' of https://github.com/pokeb/asi-http-request --- Classes/ASIHTTPRequest.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Classes/ASIHTTPRequest.m b/Classes/ASIHTTPRequest.m index 31756d2b..ece66b8a 100644 --- a/Classes/ASIHTTPRequest.m +++ b/Classes/ASIHTTPRequest.m @@ -4867,7 +4867,15 @@ + (NSDate *)expiryDateForRequest:(ASIHTTPRequest *)request maxAge:(NSTimeInterva // RFC 2612 says max-age must override any Expires header if (maxAge) { - return [[NSDate date] dateByAddingTimeInterval:maxAge]; + NSDate *date = [NSDate date]; + if ([date respondsToSelector:@selector(dateByAddingTimeInterval:)]) { + return [date dateByAddingTimeInterval:maxAge]; + } else { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [date addTimeInterval:maxAge]; +#pragma clang diagnostic pop + } } else { NSString *expires = [responseHeaders objectForKey:@"Expires"]; if (expires) { From 5b5692e1f670463f922144449bbcccf0c5416409 Mon Sep 17 00:00:00 2001 From: Zhao Yiqi Date: Tue, 18 Feb 2014 01:40:42 +0800 Subject: [PATCH 3/6] Merge remote-tracking branch 'pokeb/master' --- Classes/ASIAuthenticationDialog.m | 45 ++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/Classes/ASIAuthenticationDialog.m b/Classes/ASIAuthenticationDialog.m index 255a6849..7fb612ed 100644 --- a/Classes/ASIAuthenticationDialog.m +++ b/Classes/ASIAuthenticationDialog.m @@ -216,10 +216,20 @@ - (UITextField *)domainField + (void)dismiss { - if ([sharedDialog respondsToSelector:@selector(presentingViewController)]) - [[sharedDialog presentingViewController] dismissModalViewControllerAnimated:YES]; - else - [[sharedDialog parentViewController] dismissModalViewControllerAnimated:YES]; + UIViewController* dismisser = nil; + if ([sharedDialog respondsToSelector:@selector(presentingViewController)]){ + dismisser = [sharedDialog presentingViewController]; + }else{ + dismisser = [sharedDialog parentViewController]; + } + if([dismisser respondsToSelector:@selector(dismissViewControllerAnimated:completion:)]){ + [dismisser dismissViewControllerAnimated:YES completion:nil]; + }else{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + [dismisser dismissModalViewControllerAnimated:YES]; +#pragma clang diagnostic pop + } } - (void)viewDidDisappear:(BOOL)animated @@ -236,10 +246,20 @@ - (void)dismiss if (self == sharedDialog) { [[self class] dismiss]; } else { - if ([self respondsToSelector:@selector(presentingViewController)]) - [[self presentingViewController] dismissModalViewControllerAnimated:YES]; - else - [[self parentViewController] dismissModalViewControllerAnimated:YES]; + UIViewController* dismisser = nil; + if ([self respondsToSelector:@selector(presentingViewController)]){ + dismisser = [self presentingViewController]; + }else{ + dismisser = [self parentViewController]; + } + if([dismisser respondsToSelector:@selector(dismissViewControllerAnimated:completion:)]){ + [dismisser dismissViewControllerAnimated:YES completion:nil]; + }else{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + [dismisser dismissModalViewControllerAnimated:YES]; +#pragma clang diagnostic pop + } } } @@ -315,7 +335,14 @@ - (void)show } #endif - [[self presentingController] presentModalViewController:self animated:YES]; + if([[self presentingController] respondsToSelector:@selector(presentViewController:animated:completion:)]){ + [[self presentingController] presentViewController:self animated:YES completion:nil]; + }else{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + [[self presentingController] presentModalViewController:self animated:YES]; +#pragma clang diagnostic pop + } } #pragma mark button callbacks From 7ee5a2cfa1f1a8eb03240548dcdce7ad99140869 Mon Sep 17 00:00:00 2001 From: heroims Date: Thu, 13 Mar 2014 11:59:09 +0800 Subject: [PATCH 4/6] merge --- Classes/ASIAuthenticationDialog.m | 45 ++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/Classes/ASIAuthenticationDialog.m b/Classes/ASIAuthenticationDialog.m index 255a6849..7fb612ed 100644 --- a/Classes/ASIAuthenticationDialog.m +++ b/Classes/ASIAuthenticationDialog.m @@ -216,10 +216,20 @@ - (UITextField *)domainField + (void)dismiss { - if ([sharedDialog respondsToSelector:@selector(presentingViewController)]) - [[sharedDialog presentingViewController] dismissModalViewControllerAnimated:YES]; - else - [[sharedDialog parentViewController] dismissModalViewControllerAnimated:YES]; + UIViewController* dismisser = nil; + if ([sharedDialog respondsToSelector:@selector(presentingViewController)]){ + dismisser = [sharedDialog presentingViewController]; + }else{ + dismisser = [sharedDialog parentViewController]; + } + if([dismisser respondsToSelector:@selector(dismissViewControllerAnimated:completion:)]){ + [dismisser dismissViewControllerAnimated:YES completion:nil]; + }else{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + [dismisser dismissModalViewControllerAnimated:YES]; +#pragma clang diagnostic pop + } } - (void)viewDidDisappear:(BOOL)animated @@ -236,10 +246,20 @@ - (void)dismiss if (self == sharedDialog) { [[self class] dismiss]; } else { - if ([self respondsToSelector:@selector(presentingViewController)]) - [[self presentingViewController] dismissModalViewControllerAnimated:YES]; - else - [[self parentViewController] dismissModalViewControllerAnimated:YES]; + UIViewController* dismisser = nil; + if ([self respondsToSelector:@selector(presentingViewController)]){ + dismisser = [self presentingViewController]; + }else{ + dismisser = [self parentViewController]; + } + if([dismisser respondsToSelector:@selector(dismissViewControllerAnimated:completion:)]){ + [dismisser dismissViewControllerAnimated:YES completion:nil]; + }else{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + [dismisser dismissModalViewControllerAnimated:YES]; +#pragma clang diagnostic pop + } } } @@ -315,7 +335,14 @@ - (void)show } #endif - [[self presentingController] presentModalViewController:self animated:YES]; + if([[self presentingController] respondsToSelector:@selector(presentViewController:animated:completion:)]){ + [[self presentingController] presentViewController:self animated:YES completion:nil]; + }else{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + [[self presentingController] presentModalViewController:self animated:YES]; +#pragma clang diagnostic pop + } } #pragma mark button callbacks From ae25dcfdaedac0a059f53f54bda3126b416e4be3 Mon Sep 17 00:00:00 2001 From: Zhao Yiqi Date: Tue, 15 Apr 2014 01:27:15 +0800 Subject: [PATCH 5/6] Compatible Mac OS X --- Classes/ASIHTTPRequest.m | 6 +++--- Classes/ASIInputStream.h | 10 +++++++++- Classes/ASIInputStream.m | 11 +---------- Mac Sample/AppDelegate.m | 6 +++--- Mac.xcodeproj/project.pbxproj | 4 ++-- 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/Classes/ASIHTTPRequest.m b/Classes/ASIHTTPRequest.m index e70f2aa1..15b965db 100644 --- a/Classes/ASIHTTPRequest.m +++ b/Classes/ASIHTTPRequest.m @@ -24,7 +24,7 @@ #import "ASIDataCompressor.h" // Automatically set on build -NSString *ASIHTTPRequestVersion = @"v1.8.1-96 2014-04-15"; +NSString *ASIHTTPRequestVersion = @"v1.8.2-13 2014-04-15"; static NSString *defaultUserAgent = nil; @@ -4434,7 +4434,7 @@ + (NSString *)defaultUserAgentString if (err != noErr) return nil; err = Gestalt(gestaltSystemVersionBugFix, &versionBugFix); if (err != noErr) return nil; - OSVersion = [NSString stringWithFormat:@"%u.%u.%u", versionMajor, versionMinor, versionBugFix]; + OSVersion = [NSString stringWithFormat:@"%u.%u.%u", (int)versionMajor, (int)versionMinor, (int)versionBugFix]; #endif // Takes the form "My Application 1.0 (Macintosh; Mac OS X 10.5.7; en_GB)" @@ -4622,7 +4622,7 @@ + (unsigned long)maxUploadReadLength // We'll split our bandwidth allowance into 4 (which is the default for an ASINetworkQueue's max concurrent operations count) to give all running requests a fighting chance of reading data this cycle long long toRead = maxBandwidthPerSecond/4; - if (maxBandwidthPerSecond > 0 && (bandwidthUsedInLastSecond + toRead > maxBandwidthPerSecond)) { + if (maxBandwidthPerSecond > 0 && (((long long)bandwidthUsedInLastSecond + toRead) > (long long)maxBandwidthPerSecond)) { toRead = (long long)maxBandwidthPerSecond-(long long)bandwidthUsedInLastSecond; if (toRead < 0) { toRead = 0; diff --git a/Classes/ASIInputStream.h b/Classes/ASIInputStream.h index e3d579ef..275ce127 100644 --- a/Classes/ASIInputStream.h +++ b/Classes/ASIInputStream.h @@ -14,7 +14,15 @@ // Subclassing NSInputStream seems to be tricky, and may involve overriding undocumented methods, so we'll cheat instead. // It is used by ASIHTTPRequest whenever we have a request body, and handles measuring and throttling the bandwidth used for uploading -@interface ASIInputStream : NSObject +@interface ASIInputStream : NSObject{ + NSInputStream *stream; + id delegate; + + CFReadStreamClientCallBack copiedCallback; + CFStreamClientContext copiedContext; + CFOptionFlags requestedEvents; + ASIHTTPRequest *request; +} + (id)inputStreamWithFileAtPath:(NSString *)path request:(ASIHTTPRequest *)request; + (id)inputStreamWithData:(NSData *)data request:(ASIHTTPRequest *)request; diff --git a/Classes/ASIInputStream.m b/Classes/ASIInputStream.m index 477b2e8e..1573066f 100644 --- a/Classes/ASIInputStream.m +++ b/Classes/ASIInputStream.m @@ -14,15 +14,6 @@ static NSLock *readLock = nil; @implementation ASIInputStream -{ - NSInputStream *stream; - id delegate; - - CFReadStreamClientCallBack copiedCallback; - CFStreamClientContext copiedContext; - CFOptionFlags requestedEvents; - ASIHTTPRequest *request; -} + (void)initialize { @@ -144,7 +135,7 @@ - (NSInteger)read:(uint8_t *)buffer maxLength:(NSUInteger)len [readLock unlock]; NSInteger rv = [stream read:buffer maxLength:toRead]; if (rv > 0) - [ASIHTTPRequest incrementBandwidthUsedInLastSecond:rv]; + [ASIHTTPRequest incrementBandwidthUsedInLastSecond:(unsigned long)rv]; return rv; } diff --git a/Mac Sample/AppDelegate.m b/Mac Sample/AppDelegate.m index 8d96372d..b57e9d96 100644 --- a/Mac Sample/AppDelegate.m +++ b/Mac Sample/AppDelegate.m @@ -358,15 +358,15 @@ - (void)tableViewDataFetchFinished:(ASIHTTPRequest *)request - (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView { - return [[self rowData] count]; + return (NSInteger)[[self rowData] count]; } - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex { if ([[aTableColumn identifier] isEqualToString:@"image"]) { - return [[[self rowData] objectAtIndex:rowIndex] objectForKey:@"image"]; + return [[[self rowData] objectAtIndex:(NSUInteger)rowIndex] objectForKey:@"image"]; } else { - return [[[self rowData] objectAtIndex:rowIndex] objectForKey:@"description"]; + return [[[self rowData] objectAtIndex:(NSUInteger)rowIndex] objectForKey:@"description"]; } } diff --git a/Mac.xcodeproj/project.pbxproj b/Mac.xcodeproj/project.pbxproj index d6fa1b47..9e5ac752 100644 --- a/Mac.xcodeproj/project.pbxproj +++ b/Mac.xcodeproj/project.pbxproj @@ -713,7 +713,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.6; + MACOSX_DEPLOYMENT_TARGET = 10.5; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; @@ -726,7 +726,7 @@ GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.6; + MACOSX_DEPLOYMENT_TARGET = 10.5; SDKROOT = macosx; }; name = Release; From b0283065b394973ff8bb048b89e0567daebaf546 Mon Sep 17 00:00:00 2001 From: Zhao Yiqi Date: Fri, 10 Oct 2014 07:27:27 +0800 Subject: [PATCH 6/6] fix warning --- Classes/ASIAuthenticationDialog.m | 1 + Classes/ASIHTTPRequest.m | 2 +- iPhone.xcodeproj/project.pbxproj | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Classes/ASIAuthenticationDialog.m b/Classes/ASIAuthenticationDialog.m index 64c220e9..88e0e4cf 100644 --- a/Classes/ASIAuthenticationDialog.m +++ b/Classes/ASIAuthenticationDialog.m @@ -239,6 +239,7 @@ - (void)viewDidDisappear:(BOOL)animated sharedDialog = nil; [self performSelector:@selector(presentNextDialog) withObject:nil afterDelay:0]; [self release]; + [super viewDidDisappear:animated]; } - (void)dismiss diff --git a/Classes/ASIHTTPRequest.m b/Classes/ASIHTTPRequest.m index 15b965db..cc2b347d 100644 --- a/Classes/ASIHTTPRequest.m +++ b/Classes/ASIHTTPRequest.m @@ -24,7 +24,7 @@ #import "ASIDataCompressor.h" // Automatically set on build -NSString *ASIHTTPRequestVersion = @"v1.8.2-13 2014-04-15"; +NSString *ASIHTTPRequestVersion = @"v1.8.2-14 2014-09-19"; static NSString *defaultUserAgent = nil; diff --git a/iPhone.xcodeproj/project.pbxproj b/iPhone.xcodeproj/project.pbxproj index 704320fe..df0399d8 100644 --- a/iPhone.xcodeproj/project.pbxproj +++ b/iPhone.xcodeproj/project.pbxproj @@ -828,6 +828,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD)"; CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -840,7 +841,7 @@ GCC_VERSION = com.apple.compilers.llvm.clang.1_0; HEADER_SEARCH_PATHS = "${SDK_DIR}/usr/include/libxml2"; INFOPLIST_FILE = "iPhone Sample/iPhoneInfo.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 3.1.3; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; PRODUCT_NAME = "ASIHTTPRequest iPhone"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; TARGETED_DEVICE_FAMILY = 1; @@ -851,6 +852,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD)"; CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -860,7 +862,7 @@ GCC_VERSION = com.apple.compilers.llvm.clang.1_0; HEADER_SEARCH_PATHS = "${SDK_DIR}/usr/include/libxml2"; INFOPLIST_FILE = "iPhone Sample/iPhoneInfo.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 3.1.3; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; PRODUCT_NAME = "ASIHTTPRequest iPhone"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; TARGETED_DEVICE_FAMILY = 1;