diff --git a/Classes/ASIHTTPRequest.m b/Classes/ASIHTTPRequest.m index cb6bbeea..66df7956 100644 --- a/Classes/ASIHTTPRequest.m +++ b/Classes/ASIHTTPRequest.m @@ -1215,10 +1215,9 @@ - (void)startRequest // see: http://iphonedevelopment.blogspot.com/2010/05/nsstream-tcp-and-ssl.html NSDictionary *sslProperties = [[NSDictionary alloc] initWithObjectsAndKeys: - [NSNumber numberWithBool:YES], kCFStreamSSLAllowsExpiredCertificates, - [NSNumber numberWithBool:YES], kCFStreamSSLAllowsAnyRoot, [NSNumber numberWithBool:NO], kCFStreamSSLValidatesCertificateChain, kCFNull,kCFStreamSSLPeerName, + @"kCFStreamSocketSecurityLevelTLSv1_0SSLv3", kCFStreamSSLLevel, nil]; CFReadStreamSetProperty((CFReadStreamRef)[self readStream], @@ -4622,7 +4621,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 ((long long)maxBandwidthPerSecond > 0 && ((long long)bandwidthUsedInLastSecond + toRead > (long long)maxBandwidthPerSecond)) { toRead = (long long)maxBandwidthPerSecond-(long long)bandwidthUsedInLastSecond; if (toRead < 0) { toRead = 0; diff --git a/External/Reachability/Reachability.h b/External/Reachability/Reachability.h index dc42472b..fc3a9796 100644 --- a/External/Reachability/Reachability.h +++ b/External/Reachability/Reachability.h @@ -1,194 +1,98 @@ /* - File: Reachability.h Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. - - Version: 2.0.4ddg - */ - -/* - Significant additions made by Andrew W. Donoho, August 11, 2009. - This is a derived work of Apple's Reachability v2.0 class. - - The below license is the new BSD license with the OSI recommended personalizations. - - - Extensions Copyright (C) 2009 Donoho Design Group, LLC. All Rights Reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - * Neither the name of Andrew W. Donoho nor Donoho Design Group, L.L.C. - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY DONOHO DESIGN GROUP, L.L.C. "AS IS" AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Version: 3.5 + + Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple + Inc. ("Apple") in consideration of your agreement to the following + terms, and your use, installation, modification or redistribution of + this Apple software constitutes acceptance of these terms. If you do + not agree with these terms, please do not use, install, modify or + redistribute this Apple software. + + In consideration of your agreement to abide by the following terms, and + subject to these terms, Apple grants you a personal, non-exclusive + license, under Apple's copyrights in this original Apple software (the + "Apple Software"), to use, reproduce, modify and redistribute the Apple + Software, with or without modifications, in source and/or binary forms; + provided that if you redistribute the Apple Software in its entirety and + without modifications, you must retain this notice and the following + text and disclaimers in all such redistributions of the Apple Software. + Neither the name, trademarks, service marks or logos of Apple Inc. may + be used to endorse or promote products derived from the Apple Software + without specific prior written permission from Apple. Except as + expressly stated in this notice, no other rights or licenses, express or + implied, are granted by Apple herein, including but not limited to any + patent rights that may be infringed by your derivative works or by other + works in which the Apple Software may be incorporated. + + The Apple Software is provided by Apple on an "AS IS" basis. APPLE + MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION + THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND + OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. + + IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, + MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED + AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), + STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + Copyright (C) 2014 Apple Inc. All Rights Reserved. */ - -/* - - Apple's Original License on Reachability v2.0 - - Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. - ("Apple") in consideration of your agreement to the following terms, and your - use, installation, modification or redistribution of this Apple software - constitutes acceptance of these terms. If you do not agree with these terms, - please do not use, install, modify or redistribute this Apple software. - - In consideration of your agreement to abide by the following terms, and subject - to these terms, Apple grants you a personal, non-exclusive license, under - Apple's copyrights in this original Apple software (the "Apple Software"), to - use, reproduce, modify and redistribute the Apple Software, with or without - modifications, in source and/or binary forms; provided that if you redistribute - the Apple Software in its entirety and without modifications, you must retain - this notice and the following text and disclaimers in all such redistributions - of the Apple Software. - - Neither the name, trademarks, service marks or logos of Apple Inc. may be used - to endorse or promote products derived from the Apple Software without specific - prior written permission from Apple. Except as expressly stated in this notice, - no other rights or licenses, express or implied, are granted by Apple herein, - including but not limited to any patent rights that may be infringed by your - derivative works or by other works in which the Apple Software may be - incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO - WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED - WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN - COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR - DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF - CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF - APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - Copyright (C) 2009 Apple Inc. All Rights Reserved. - - */ - - -/* - DDG extensions include: - Each reachability object now has a copy of the key used to store it in a - dictionary. This allows each observer to quickly determine if the event is - important to them. - - -currentReachabilityStatus also has a significantly different decision criteria than - Apple's code. - - A multiple convenience test methods have been added. - */ - #import #import #import -#define USE_DDG_EXTENSIONS 1 // Use DDG's Extensions to test network criteria. -// Since NSAssert and NSCAssert are used in this code, -// I recommend you set NS_BLOCK_ASSERTIONS=1 in the release versions of your projects. - -enum { - - // DDG NetworkStatus Constant Names. - kNotReachable = 0, // Apple's code depends upon 'NotReachable' being the same value as 'NO'. - kReachableViaWWAN, // Switched order from Apple's enum. WWAN is active before WiFi. - kReachableViaWiFi - -}; -typedef uint32_t NetworkStatus; - -enum { - - // Apple NetworkStatus Constant Names. - NotReachable = kNotReachable, - ReachableViaWiFi = kReachableViaWiFi, - ReachableViaWWAN = kReachableViaWWAN - -}; - - -extern NSString *const kInternetConnection; -extern NSString *const kLocalWiFiConnection; -extern NSString *const kReachabilityChangedNotification; -@interface Reachability: NSObject { - -@private - NSString *key_; - SCNetworkReachabilityRef reachabilityRef; +typedef enum : NSInteger { + NotReachable = 0, + ReachableViaWiFi, + ReachableViaWWAN +} NetworkStatus; -} -@property (atomic, copy) NSString *key; // Atomic because network operations are asynchronous. +extern NSString *kReachabilityChangedNotification; -// Designated Initializer. -- (Reachability *) initWithReachabilityRef: (SCNetworkReachabilityRef) ref; -// Use to check the reachability of a particular host name. -+ (Reachability *) reachabilityWithHostName: (NSString*) hostName; +@interface Reachability : NSObject -// Use to check the reachability of a particular IP address. -+ (Reachability *) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress; - -// Use to check whether the default route is available. -// Should be used to, at minimum, establish network connectivity. -+ (Reachability *) reachabilityForInternetConnection; - -// Use to check whether a local wifi connection is available. -+ (Reachability *) reachabilityForLocalWiFi; - -//Start listening for reachability notifications on the current run loop. -- (BOOL) startNotifier; -- (void) stopNotifier; - -// Comparison routines to enable choosing actions in a notification. -- (BOOL) isEqual: (Reachability *) r; - -// These are the status tests. -- (NetworkStatus) currentReachabilityStatus; +/*! + * Use to check the reachability of a given host name. + */ ++ (instancetype)reachabilityWithHostName:(NSString *)hostName; -// The main direct test of reachability. -- (BOOL) isReachable; +/*! + * Use to check the reachability of a given IP address. + */ ++ (instancetype)reachabilityWithAddress:(const struct sockaddr_in *)hostAddress; -// WWAN may be available, but not active until a connection has been established. -// WiFi may require a connection for VPN on Demand. -- (BOOL) isConnectionRequired; // Identical DDG variant. -- (BOOL) connectionRequired; // Apple's routine. +/*! + * Checks whether the default route is available. Should be used by applications that do not connect to a particular host. + */ ++ (instancetype)reachabilityForInternetConnection; -// Dynamic, on demand connection? -- (BOOL) isConnectionOnDemand; +/*! + * Checks whether a local WiFi connection is available. + */ ++ (instancetype)reachabilityForLocalWiFi; -// Is user intervention required? -- (BOOL) isInterventionRequired; +/*! + * Start listening for reachability notifications on the current run loop. + */ +- (BOOL)startNotifier; +- (void)stopNotifier; -// Routines for specific connection testing by your app. -- (BOOL) isReachableViaWWAN; -- (BOOL) isReachableViaWiFi; +- (NetworkStatus)currentReachabilityStatus; -- (SCNetworkReachabilityFlags) reachabilityFlags; +/*! + * WWAN may be available, but not active until a connection has been established. WiFi may require a connection for VPN on Demand. + */ +- (BOOL)connectionRequired; -@end +@end \ No newline at end of file diff --git a/External/Reachability/Reachability.m b/External/Reachability/Reachability.m index 8648ea69..8dd4b960 100644 --- a/External/Reachability/Reachability.m +++ b/External/Reachability/Reachability.m @@ -1,814 +1,322 @@ /* - File: Reachability.m Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. + Version: 3.5 - Version: 2.0.4ddg - */ - -/* - Significant additions made by Andrew W. Donoho, August 11, 2009. - This is a derived work of Apple's Reachability v2.0 class. + Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple + Inc. ("Apple") in consideration of your agreement to the following + terms, and your use, installation, modification or redistribution of + this Apple software constitutes acceptance of these terms. If you do + not agree with these terms, please do not use, install, modify or + redistribute this Apple software. - The below license is the new BSD license with the OSI recommended personalizations. - - - Extensions Copyright (C) 2009 Donoho Design Group, LLC. All Rights Reserved. + In consideration of your agreement to abide by the following terms, and + subject to these terms, Apple grants you a personal, non-exclusive + license, under Apple's copyrights in this original Apple software (the + "Apple Software"), to use, reproduce, modify and redistribute the Apple + Software, with or without modifications, in source and/or binary forms; + provided that if you redistribute the Apple Software in its entirety and + without modifications, you must retain this notice and the following + text and disclaimers in all such redistributions of the Apple Software. + Neither the name, trademarks, service marks or logos of Apple Inc. may + be used to endorse or promote products derived from the Apple Software + without specific prior written permission from Apple. Except as + expressly stated in this notice, no other rights or licenses, express or + implied, are granted by Apple herein, including but not limited to any + patent rights that may be infringed by your derivative works or by other + works in which the Apple Software may be incorporated. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: + The Apple Software is provided by Apple on an "AS IS" basis. APPLE + MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION + THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND + OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, + MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED + AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), + STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - * Neither the name of Andrew W. Donoho nor Donoho Design Group, L.L.C. - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY DONOHO DESIGN GROUP, L.L.C. "AS IS" AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Copyright (C) 2014 Apple Inc. All Rights Reserved. */ - -/* - - Apple's Original License on Reachability v2.0 - - Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. - ("Apple") in consideration of your agreement to the following terms, and your - use, installation, modification or redistribution of this Apple software - constitutes acceptance of these terms. If you do not agree with these terms, - please do not use, install, modify or redistribute this Apple software. - - In consideration of your agreement to abide by the following terms, and subject - to these terms, Apple grants you a personal, non-exclusive license, under - Apple's copyrights in this original Apple software (the "Apple Software"), to - use, reproduce, modify and redistribute the Apple Software, with or without - modifications, in source and/or binary forms; provided that if you redistribute - the Apple Software in its entirety and without modifications, you must retain - this notice and the following text and disclaimers in all such redistributions - of the Apple Software. - - Neither the name, trademarks, service marks or logos of Apple Inc. may be used - to endorse or promote products derived from the Apple Software without specific - prior written permission from Apple. Except as expressly stated in this notice, - no other rights or licenses, express or implied, are granted by Apple herein, - including but not limited to any patent rights that may be infringed by your - derivative works or by other works in which the Apple Software may be - incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO - WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED - WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN - COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR - DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF - CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF - APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - Copyright (C) 2009 Apple Inc. All Rights Reserved. - -*/ - -/* - Each reachability object now has a copy of the key used to store it in a dictionary. - This allows each observer to quickly determine if the event is important to them. -*/ - -#import -#import -#import #import #import #import +#import #import #import "Reachability.h" -NSString *const kInternetConnection = @"InternetConnection"; -NSString *const kLocalWiFiConnection = @"LocalWiFiConnection"; -NSString *const kReachabilityChangedNotification = @"NetworkReachabilityChangedNotification"; - -#define CLASS_DEBUG 1 // Turn on logReachabilityFlags. Must also have a project wide defined DEBUG. - -#if (defined DEBUG && defined CLASS_DEBUG) -#define logReachabilityFlags(flags) (logReachabilityFlags_(__PRETTY_FUNCTION__, __LINE__, flags)) - -static NSString *reachabilityFlags_(SCNetworkReachabilityFlags flags) { - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 30000) // Apple advises you to use the magic number instead of a symbol. - return [NSString stringWithFormat:@"Reachability Flags: %c%c %c%c%c%c%c%c%c", - (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-', - (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-', - - (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-', - (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-', - (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-', - (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-', - (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-']; -#else - // Compile out the v3.0 features for v2.2.1 deployment. - return [NSString stringWithFormat:@"Reachability Flags: %c%c %c%c%c%c%c%c", - (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-', - (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-', - - (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-', - (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-', - (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', - // v3 kSCNetworkReachabilityFlagsConnectionOnTraffic == v2 kSCNetworkReachabilityFlagsConnectionAutomatic - (flags & kSCNetworkReachabilityFlagsConnectionAutomatic) ? 'C' : '-', - // (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-', // No v2 equivalent. - (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-', - (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-']; -#endif - -} // reachabilityFlags_() - -static void logReachabilityFlags_(const char *name, int line, SCNetworkReachabilityFlags flags) { - - NSLog(@"%s (%d) \n\t%@", name, line, reachabilityFlags_(flags)); - -} // logReachabilityFlags_() - -#define logNetworkStatus(status) (logNetworkStatus_(__PRETTY_FUNCTION__, __LINE__, status)) - -static void logNetworkStatus_(const char *name, int line, NetworkStatus status) { - - NSString *statusString = nil; - - switch (status) { - case kNotReachable: - statusString = @"Not Reachable"; - break; - case kReachableViaWWAN: - statusString = @"Reachable via WWAN"; - break; - case kReachableViaWiFi: - statusString = @"Reachable via WiFi"; - break; - } - - NSLog(@"%s (%d) \n\tNetwork Status: %@", name, line, statusString); - -} // logNetworkStatus_() - -#else -#define logReachabilityFlags(flags) -#define logNetworkStatus(status) + +NSString *kReachabilityChangedNotification = @"kNetworkReachabilityChangedNotification"; + + +#pragma mark - Supporting functions + +#define kShouldPrintReachabilityFlags 1 + +static void PrintReachabilityFlags(SCNetworkReachabilityFlags flags, const char* comment) +{ +#if kShouldPrintReachabilityFlags + + NSLog(@"Reachability Flag Status: %c%c %c%c%c%c%c%c%c %s\n", + (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-', + (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-', + + (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-', + (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-', + (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-', + (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-', + comment + ); #endif +} + -@interface Reachability (private) +static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info) +{ +#pragma unused (target, flags) + NSCAssert(info != NULL, @"info was NULL in ReachabilityCallback"); + NSCAssert([(__bridge NSObject*) info isKindOfClass: [Reachability class]], @"info was wrong class in ReachabilityCallback"); + + Reachability* noteObject = (__bridge Reachability *)info; + // Post a notification to notify the client that the network reachability changed. + [[NSNotificationCenter defaultCenter] postNotificationName: kReachabilityChangedNotification object: noteObject]; +} -- (NetworkStatus) networkStatusForFlags: (SCNetworkReachabilityFlags) flags; -@end +#pragma mark - Reachability implementation @implementation Reachability +{ + BOOL _alwaysReturnLocalWiFiStatus; //default is NO + SCNetworkReachabilityRef _reachabilityRef; +} -@synthesize key = key_; ++ (instancetype)reachabilityWithHostName:(NSString *)hostName +{ + Reachability* returnValue = NULL; + SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, [hostName UTF8String]); + if (reachability != NULL) + { + returnValue= [[self alloc] init]; + if (returnValue != NULL) + { + returnValue->_reachabilityRef = reachability; + returnValue->_alwaysReturnLocalWiFiStatus = NO; + } + } + #if !__has_feature(objc_arc) + return [returnValue autorelease]; + #else + return returnValue; + #endif +} -// Preclude direct access to ivars. -+ (BOOL) accessInstanceVariablesDirectly { - - return NO; -} // accessInstanceVariablesDirectly ++ (instancetype)reachabilityWithAddress:(const struct sockaddr_in *)hostAddress +{ + SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr *)hostAddress); + + Reachability* returnValue = NULL; + + if (reachability != NULL) + { + returnValue = [[self alloc] init]; + if (returnValue != NULL) + { + returnValue->_reachabilityRef = reachability; + returnValue->_alwaysReturnLocalWiFiStatus = NO; + } + } + #if !__has_feature(objc_arc) + return [returnValue autorelease]; + #else + return returnValue; + #endif +} -- (void) dealloc { - - [self stopNotifier]; - if(reachabilityRef) { - - CFRelease(reachabilityRef); reachabilityRef = NULL; - - } - - self.key = nil; - - [super dealloc]; - -} // dealloc + ++ (instancetype)reachabilityForInternetConnection +{ + struct sockaddr_in zeroAddress; + bzero(&zeroAddress, sizeof(zeroAddress)); + zeroAddress.sin_len = sizeof(zeroAddress); + zeroAddress.sin_family = AF_INET; + + return [self reachabilityWithAddress:&zeroAddress]; +} -- (Reachability *) initWithReachabilityRef: (SCNetworkReachabilityRef) ref ++ (instancetype)reachabilityForLocalWiFi { - self = [super init]; - if (self != nil) + struct sockaddr_in localWifiAddress; + bzero(&localWifiAddress, sizeof(localWifiAddress)); + localWifiAddress.sin_len = sizeof(localWifiAddress); + localWifiAddress.sin_family = AF_INET; + + // IN_LINKLOCALNETNUM is defined in as 169.254.0.0. + localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM); + + Reachability* returnValue = [self reachabilityWithAddress: &localWifiAddress]; + if (returnValue != NULL) { - reachabilityRef = ref; - } - - return self; - -} // initWithReachabilityRef: - - -#if (defined DEBUG && defined CLASS_DEBUG) -- (NSString *) description { - - NSAssert(reachabilityRef, @"-description called with NULL reachabilityRef"); - - SCNetworkReachabilityFlags flags = 0; - - SCNetworkReachabilityGetFlags(reachabilityRef, &flags); - - return [NSString stringWithFormat: @"%@\n\t%@", self.key, reachabilityFlags_(flags)]; - -} // description -#endif + returnValue->_alwaysReturnLocalWiFiStatus = YES; + } + + return returnValue; +} -#pragma mark - -#pragma mark Notification Management Methods - - -//Start listening for reachability notifications on the current run loop -static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info) { - - #pragma unused (target, flags) - NSCAssert(info, @"info was NULL in ReachabilityCallback"); - NSCAssert([(NSObject*) info isKindOfClass: [Reachability class]], @"info was the wrong class in ReachabilityCallback"); - - //We're on the main RunLoop, so an NSAutoreleasePool is not necessary, but is added defensively - // in case someone uses the Reachablity object in a different thread. - NSAutoreleasePool* pool = [NSAutoreleasePool new]; - - // Post a notification to notify the client that the network reachability changed. - [[NSNotificationCenter defaultCenter] postNotificationName: kReachabilityChangedNotification - object: (Reachability *) info]; - - [pool release]; - -} // ReachabilityCallback() - - -- (BOOL) startNotifier { - - SCNetworkReachabilityContext context = {0, self, NULL, NULL, NULL}; - - if(SCNetworkReachabilitySetCallback(reachabilityRef, ReachabilityCallback, &context)) { - - if(SCNetworkReachabilityScheduleWithRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)) { - - return YES; - - } - - } - - return NO; - -} // startNotifier - - -- (void) stopNotifier { - - if(reachabilityRef) { - - SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); - - } - -} // stopNotifier +#pragma mark - Start and stop notifier - -- (BOOL) isEqual: (Reachability *) r { - - return [r.key isEqualToString: self.key]; - -} // isEqual: +- (BOOL)startNotifier +{ + BOOL returnValue = NO; + SCNetworkReachabilityContext context = {0, (__bridge void *)(self), NULL, NULL, NULL}; + + if (SCNetworkReachabilitySetCallback(_reachabilityRef, ReachabilityCallback, &context)) + { + if (SCNetworkReachabilityScheduleWithRunLoop(_reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)) + { + returnValue = YES; + } + } + + return returnValue; +} -#pragma mark - -#pragma mark Reachability Allocation Methods +- (void)stopNotifier +{ + if (_reachabilityRef != NULL) + { + SCNetworkReachabilityUnscheduleFromRunLoop(_reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); + } +} -+ (Reachability *) reachabilityWithHostName: (NSString *) hostName { - - SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithName(NULL, [hostName UTF8String]); - - if (ref) { - - Reachability *r = [[[self alloc] initWithReachabilityRef: ref] autorelease]; - - r.key = hostName; - - return r; - - } - - return nil; - -} // reachabilityWithHostName - - -+ (NSString *) makeAddressKey: (in_addr_t) addr { - // addr is assumed to be in network byte order. - - static const int highShift = 24; - static const int highMidShift = 16; - static const int lowMidShift = 8; - static const in_addr_t mask = 0x000000ff; - - addr = ntohl(addr); - - return [NSString stringWithFormat: @"%d.%d.%d.%d", - (addr >> highShift) & mask, - (addr >> highMidShift) & mask, - (addr >> lowMidShift) & mask, - addr & mask]; - -} // makeAddressKey: - - -+ (Reachability *) reachabilityWithAddress: (const struct sockaddr_in *) hostAddress { - - SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress); - - if (ref) { - - Reachability *r = [[[self alloc] initWithReachabilityRef: ref] autorelease]; - - r.key = [self makeAddressKey: hostAddress->sin_addr.s_addr]; - - return r; - - } - - return nil; - -} // reachabilityWithAddress - - -+ (Reachability *) reachabilityForInternetConnection { - - struct sockaddr_in zeroAddress; - bzero(&zeroAddress, sizeof(zeroAddress)); - zeroAddress.sin_len = sizeof(zeroAddress); - zeroAddress.sin_family = AF_INET; - - Reachability *r = [self reachabilityWithAddress: &zeroAddress]; - - r.key = kInternetConnection; - - return r; - -} // reachabilityForInternetConnection - - -+ (Reachability *) reachabilityForLocalWiFi { - - struct sockaddr_in localWifiAddress; - bzero(&localWifiAddress, sizeof(localWifiAddress)); - localWifiAddress.sin_len = sizeof(localWifiAddress); - localWifiAddress.sin_family = AF_INET; - // IN_LINKLOCALNETNUM is defined in as 169.254.0.0 - localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM); - - Reachability *r = [self reachabilityWithAddress: &localWifiAddress]; - - r.key = kLocalWiFiConnection; - - return r; - -} // reachabilityForLocalWiFi - - -#pragma mark - -#pragma mark Network Flag Handling Methods - - -#if USE_DDG_EXTENSIONS -// -// iPhone condition codes as reported by a 3GS running iPhone OS v3.0. -// Airplane Mode turned on: Reachability Flag Status: -- ------- -// WWAN Active: Reachability Flag Status: WR -t----- -// WWAN Connection required: Reachability Flag Status: WR ct----- -// WiFi turned on: Reachability Flag Status: -R ------- Reachable. -// Local WiFi turned on: Reachability Flag Status: -R xxxxxxd Reachable. -// WiFi turned on: Reachability Flag Status: -R ct----- Connection down. (Non-intuitive, empirically determined answer.) -const SCNetworkReachabilityFlags kConnectionDown = kSCNetworkReachabilityFlagsConnectionRequired | - kSCNetworkReachabilityFlagsTransientConnection; -// WiFi turned on: Reachability Flag Status: -R ct-i--- Reachable but it will require user intervention (e.g. enter a WiFi password). -// WiFi turned on: Reachability Flag Status: -R -t----- Reachable via VPN. -// -// In the below method, an 'x' in the flag status means I don't care about its value. -// -// This method differs from Apple's by testing explicitly for empirically observed values. -// This gives me more confidence in it's correct behavior. Apple's code covers more cases -// than mine. My code covers the cases that occur. -// -- (NetworkStatus) networkStatusForFlags: (SCNetworkReachabilityFlags) flags { - - if (flags & kSCNetworkReachabilityFlagsReachable) { - - // Local WiFi -- Test derived from Apple's code: -localWiFiStatusForFlags:. - if (self.key == kLocalWiFiConnection) { - - // Reachability Flag Status: xR xxxxxxd Reachable. - return (flags & kSCNetworkReachabilityFlagsIsDirect) ? kReachableViaWiFi : kNotReachable; - - } - - // Observed WWAN Values: - // WWAN Active: Reachability Flag Status: WR -t----- - // WWAN Connection required: Reachability Flag Status: WR ct----- - // - // Test Value: Reachability Flag Status: WR xxxxxxx - if (flags & kSCNetworkReachabilityFlagsIsWWAN) { return kReachableViaWWAN; } - - // Clear moot bits. - flags &= ~(uint32_t)kSCNetworkReachabilityFlagsReachable; - flags &= ~(uint32_t)kSCNetworkReachabilityFlagsIsDirect; - flags &= ~(uint32_t)kSCNetworkReachabilityFlagsIsLocalAddress; // kInternetConnection is local. - - // Reachability Flag Status: -R ct---xx Connection down. - if (flags == kConnectionDown) { return kNotReachable; } - - // Reachability Flag Status: -R -t---xx Reachable. WiFi + VPN(is up) (Thank you Ling Wang) - if (flags & kSCNetworkReachabilityFlagsTransientConnection) { return kReachableViaWiFi; } - - // Reachability Flag Status: -R -----xx Reachable. - if (flags == 0) { return kReachableViaWiFi; } - - // Apple's code tests for dynamic connection types here. I don't. - // If a connection is required, regardless of whether it is on demand or not, it is a WiFi connection. - // If you care whether a connection needs to be brought up, use -isConnectionRequired. - // If you care about whether user intervention is necessary, use -isInterventionRequired. - // If you care about dynamically establishing the connection, use -isConnectionIsOnDemand. - - // Reachability Flag Status: -R cxxxxxx Reachable. - if (flags & kSCNetworkReachabilityFlagsConnectionRequired) { return kReachableViaWiFi; } - - // Required by the compiler. Should never get here. Default to not connected. -#if (defined DEBUG && defined CLASS_DEBUG) - NSAssert1(NO, @"Uncaught reachability test. Flags: %@", reachabilityFlags_(flags)); -#endif - return kNotReachable; - - } - - // Reachability Flag Status: x- xxxxxxx - return kNotReachable; - -} // networkStatusForFlags: - - -- (NetworkStatus) currentReachabilityStatus { - - NSAssert(reachabilityRef, @"currentReachabilityStatus called with NULL reachabilityRef"); - - SCNetworkReachabilityFlags flags = 0; - NetworkStatus status = kNotReachable; - - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { - -// logReachabilityFlags(flags); - - status = [self networkStatusForFlags: flags]; - - return status; - - } - - return kNotReachable; - -} // currentReachabilityStatus - - -- (BOOL) isReachable { - - NSAssert(reachabilityRef, @"isReachable called with NULL reachabilityRef"); - - SCNetworkReachabilityFlags flags = 0; - NetworkStatus status = kNotReachable; - - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { - -// logReachabilityFlags(flags); - - status = [self networkStatusForFlags: flags]; - -// logNetworkStatus(status); - - return (kNotReachable != status); - - } - - return NO; - -} // isReachable - - -- (BOOL) isConnectionRequired { - - NSAssert(reachabilityRef, @"isConnectionRequired called with NULL reachabilityRef"); - - SCNetworkReachabilityFlags flags; - - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { - - logReachabilityFlags(flags); - - return (flags & kSCNetworkReachabilityFlagsConnectionRequired); - - } - - return NO; - -} // isConnectionRequired - - -- (BOOL) connectionRequired { - - return [self isConnectionRequired]; - -} // connectionRequired +- (void)dealloc +{ + [self stopNotifier]; + if (_reachabilityRef != NULL) + { + CFRelease(_reachabilityRef); + } +#if !__has_feature(objc_arc) + return [super dealloc]; #endif +} -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 30000) -static const SCNetworkReachabilityFlags kOnDemandConnection = kSCNetworkReachabilityFlagsConnectionOnTraffic | - kSCNetworkReachabilityFlagsConnectionOnDemand; -#else -static const SCNetworkReachabilityFlags kOnDemandConnection = kSCNetworkReachabilityFlagsConnectionAutomatic; -#endif - -- (BOOL) isConnectionOnDemand { - - NSAssert(reachabilityRef, @"isConnectionIsOnDemand called with NULL reachabilityRef"); - - SCNetworkReachabilityFlags flags; - - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { - - logReachabilityFlags(flags); - - return ((flags & kSCNetworkReachabilityFlagsConnectionRequired) && - (flags & kOnDemandConnection)); - - } - - return NO; - -} // isConnectionOnDemand - - -- (BOOL) isInterventionRequired { - - NSAssert(reachabilityRef, @"isInterventionRequired called with NULL reachabilityRef"); - - SCNetworkReachabilityFlags flags; - - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { - - logReachabilityFlags(flags); - - return ((flags & kSCNetworkReachabilityFlagsConnectionRequired) && - (flags & kSCNetworkReachabilityFlagsInterventionRequired)); - - } - - return NO; - -} // isInterventionRequired - - -- (BOOL) isReachableViaWWAN { - - NSAssert(reachabilityRef, @"isReachableViaWWAN called with NULL reachabilityRef"); - - SCNetworkReachabilityFlags flags = 0; - NetworkStatus status = kNotReachable; - - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { - - logReachabilityFlags(flags); - - status = [self networkStatusForFlags: flags]; - - return (kReachableViaWWAN == status); - - } - - return NO; - -} // isReachableViaWWAN - - -- (BOOL) isReachableViaWiFi { - - NSAssert(reachabilityRef, @"isReachableViaWiFi called with NULL reachabilityRef"); - - SCNetworkReachabilityFlags flags = 0; - NetworkStatus status = kNotReachable; - - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { - - logReachabilityFlags(flags); - - status = [self networkStatusForFlags: flags]; - - return (kReachableViaWiFi == status); - - } - - return NO; - -} // isReachableViaWiFi - - -- (SCNetworkReachabilityFlags) reachabilityFlags { - - NSAssert(reachabilityRef, @"reachabilityFlags called with NULL reachabilityRef"); - - SCNetworkReachabilityFlags flags = 0; - - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { - - logReachabilityFlags(flags); - - return flags; - - } - - return 0; - -} // reachabilityFlags - - -#pragma mark - -#pragma mark Apple's Network Flag Handling Methods - - -#if !USE_DDG_EXTENSIONS -/* - * - * Apple's Network Status testing code. - * The only changes that have been made are to use the new logReachabilityFlags macro and - * test for local WiFi via the key instead of Apple's boolean. Also, Apple's code was for v3.0 only - * iPhone OS. v2.2.1 and earlier conditional compiling is turned on. Hence, to mirror Apple's behavior, - * set your Base SDK to v3.0 or higher. - * - */ +#pragma mark - Network Flag Handling -- (NetworkStatus) localWiFiStatusForFlags: (SCNetworkReachabilityFlags) flags +- (NetworkStatus)localWiFiStatusForFlags:(SCNetworkReachabilityFlags)flags { - logReachabilityFlags(flags); - - BOOL retVal = NotReachable; - if((flags & kSCNetworkReachabilityFlagsReachable) && (flags & kSCNetworkReachabilityFlagsIsDirect)) - { - retVal = ReachableViaWiFi; - } - return retVal; + PrintReachabilityFlags(flags, "localWiFiStatusForFlags"); + NetworkStatus returnValue = NotReachable; + + if ((flags & kSCNetworkReachabilityFlagsReachable) && (flags & kSCNetworkReachabilityFlagsIsDirect)) + { + returnValue = ReachableViaWiFi; + } + + return returnValue; } -- (NetworkStatus) networkStatusForFlags: (SCNetworkReachabilityFlags) flags +- (NetworkStatus)networkStatusForFlags:(SCNetworkReachabilityFlags)flags { - logReachabilityFlags(flags); - if (!(flags & kSCNetworkReachabilityFlagsReachable)) - { - // if target host is not reachable - return NotReachable; - } - - BOOL retVal = NotReachable; - - if (!(flags & kSCNetworkReachabilityFlagsConnectionRequired)) - { - // if target host is reachable and no connection is required - // then we'll assume (for now) that your on Wi-Fi - retVal = ReachableViaWiFi; - } - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 30000) // Apple advises you to use the magic number instead of a symbol. - if ((flags & kSCNetworkReachabilityFlagsConnectionOnDemand) || - (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic)) -#else - if (flags & kSCNetworkReachabilityFlagsConnectionAutomatic) -#endif - { - // ... and the connection is on-demand (or on-traffic) if the - // calling application is using the CFSocketStream or higher APIs - - if (!(flags & kSCNetworkReachabilityFlagsInterventionRequired)) - { - // ... and no [user] intervention is needed - retVal = ReachableViaWiFi; - } - } - - if (flags & kSCNetworkReachabilityFlagsIsWWAN) - { - // ... but WWAN connections are OK if the calling application - // is using the CFNetwork (CFSocketStream?) APIs. - retVal = ReachableViaWWAN; - } - return retVal; + PrintReachabilityFlags(flags, "networkStatusForFlags"); + if ((flags & kSCNetworkReachabilityFlagsReachable) == 0) + { + // The target host is not reachable. + return NotReachable; + } + + NetworkStatus returnValue = NotReachable; + + if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0) + { + /* + If the target host is reachable and no connection is required then we'll assume (for now) that you're on Wi-Fi... + */ + returnValue = ReachableViaWiFi; + } + + if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) || + (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0)) + { + /* + ... and the connection is on-demand (or on-traffic) if the calling application is using the CFSocketStream or higher APIs... + */ + + if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0) + { + /* + ... and no [user] intervention is needed... + */ + returnValue = ReachableViaWiFi; + } + } + + if ((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN) + { + /* + ... but WWAN connections are OK if the calling application is using the CFNetwork APIs. + */ + returnValue = ReachableViaWWAN; + } + + return returnValue; } -- (NetworkStatus) currentReachabilityStatus +- (BOOL)connectionRequired { - NSAssert(reachabilityRef, @"currentReachabilityStatus called with NULL reachabilityRef"); - - NetworkStatus retVal = NotReachable; - SCNetworkReachabilityFlags flags; - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) - { - if(self.key == kLocalWiFiConnection) - { - retVal = [self localWiFiStatusForFlags: flags]; - } - else - { - retVal = [self networkStatusForFlags: flags]; - } - } - return retVal; + NSAssert(_reachabilityRef != NULL, @"connectionRequired called with NULL reachabilityRef"); + SCNetworkReachabilityFlags flags; + + if (SCNetworkReachabilityGetFlags(_reachabilityRef, &flags)) + { + return (flags & kSCNetworkReachabilityFlagsConnectionRequired); + } + + return NO; } -- (BOOL) isReachable { - - NSAssert(reachabilityRef, @"isReachable called with NULL reachabilityRef"); - - SCNetworkReachabilityFlags flags = 0; - NetworkStatus status = kNotReachable; - - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { - - logReachabilityFlags(flags); - - if(self.key == kLocalWiFiConnection) { - - status = [self localWiFiStatusForFlags: flags]; - - } else { - - status = [self networkStatusForFlags: flags]; - - } - - return (kNotReachable != status); - - } - - return NO; - -} // isReachable - - -- (BOOL) isConnectionRequired { - - return [self connectionRequired]; - -} // isConnectionRequired - - -- (BOOL) connectionRequired { - - NSAssert(reachabilityRef, @"connectionRequired called with NULL reachabilityRef"); - - SCNetworkReachabilityFlags flags; - - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { - - logReachabilityFlags(flags); - - return (flags & kSCNetworkReachabilityFlagsConnectionRequired); - - } - - return NO; - -} // connectionRequired -#endif +- (NetworkStatus)currentReachabilityStatus +{ + NSAssert(_reachabilityRef != NULL, @"currentNetworkStatus called with NULL SCNetworkReachabilityRef"); + NetworkStatus returnValue = NotReachable; + SCNetworkReachabilityFlags flags; + + if (SCNetworkReachabilityGetFlags(_reachabilityRef, &flags)) + { + if (_alwaysReturnLocalWiFiStatus) + { + returnValue = [self localWiFiStatusForFlags:flags]; + } + else + { + returnValue = [self networkStatusForFlags:flags]; + } + } + + return returnValue; +} + -@end +@end \ No newline at end of file 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 Sample/English.lproj/MainMenu.xib b/Mac Sample/English.lproj/MainMenu.xib index a4659bb5..219e4ac8 100644 --- a/Mac Sample/English.lproj/MainMenu.xib +++ b/Mac Sample/English.lproj/MainMenu.xib @@ -1,5874 +1,1046 @@ - - - - 1050 - 11A511 - 1617 - 1138 - 566.00 - - YES - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.WebKitIBPlugin - - - YES - 1617 - 518 - - - - YES - NSTextView - WebView - NSMenu - NSButton - NSCustomObject - NSImageView - NSImageCell - NSTableView - NSTextField - NSWindowTemplate - NSTextFieldCell - NSButtonCell - NSTableColumn - NSView - NSScrollView - NSTabViewItem - NSProgressIndicator - NSScroller - NSMenuItem - NSTabView - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.WebKitIBPlugin - - - YES - - YES - - - - - YES - - NSApplication - - - FirstResponder - - - NSApplication - - - AMainMenu - - YES - - - NewApplication - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - NewApplication - - YES - - - About NewApplication - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Services - - 1048576 - 2147483647 - - - submenuAction: - - Services - - YES - - _NSServicesMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Hide NewApplication - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Quit NewApplication - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - File - - 1048576 - 2147483647 - - - submenuAction: - - File - - YES - - - New - n - 1048576 - 2147483647 - - - - - - Open… - o - 1048576 - 2147483647 - - - - - - Open Recent - - 1048576 - 2147483647 - - - submenuAction: - - Open Recent - - YES - - - Clear Menu - - 1048576 - 2147483647 - - - - - _NSRecentDocumentsMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Close - w - 1048576 - 2147483647 - - - - - - Save - s - 1048576 - 2147483647 - - - - - - Save As… - S - 1179648 - 2147483647 - - - - - - Revert to Saved - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Page Setup... - P - 1179648 - 2147483647 - - - - - - - Print… - p - 1048576 - 2147483647 - - - - - - - - - Edit - - 1048576 - 2147483647 - - - submenuAction: - - Edit - - YES - - - Undo - z - 1048576 - 2147483647 - - - - - - Redo - Z - 1179648 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Cut - x - 1048576 - 2147483647 - - - - - - Copy - c - 1048576 - 2147483647 - - - - - - Paste - v - 1048576 - 2147483647 - - - - - - Delete - - 1048576 - 2147483647 - - - - - - Select All - a - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Find - - 1048576 - 2147483647 - - - submenuAction: - - Find - - YES - - - Find… - f - 1048576 - 2147483647 - - - 1 - - - - Find Next - g - 1048576 - 2147483647 - - - 2 - - - - Find Previous - G - 1179648 - 2147483647 - - - 3 - - - - Use Selection for Find - e - 1048576 - 2147483647 - - - 7 - - - - Jump to Selection - j - 1048576 - 2147483647 - - - - - - - - - Spelling and Grammar - - 1048576 - 2147483647 - - - submenuAction: - - Spelling and Grammar - - YES - - - Show Spelling… - : - 1048576 - 2147483647 - - - - - - Check Spelling - ; - 1048576 - 2147483647 - - - - - - Check Spelling While Typing - - 1048576 - 2147483647 - - - - - - Check Grammar With Spelling - - 1048576 - 2147483647 - - - - - - - - - Substitutions - - 1048576 - 2147483647 - - - submenuAction: - - Substitutions - - YES - - - Smart Copy/Paste - f - 1048576 - 2147483647 - - - 1 - - - - Smart Quotes - g - 1048576 - 2147483647 - - - 2 - - - - Smart Links - G - 1179648 - 2147483647 - - - 3 - - - - - - - Speech - - 1048576 - 2147483647 - - - submenuAction: - - Speech - - YES - - - Start Speaking - - 1048576 - 2147483647 - - - - - - Stop Speaking - - 1048576 - 2147483647 - - - - - - - - - - - - Format - - 1048576 - 2147483647 - - - submenuAction: - - Format - - YES - - - Show Fonts - t - 1048576 - 2147483647 - - - - - - Show Colors - C - 1179648 - 2147483647 - - - - - - - - - View - - 1048576 - 2147483647 - - - submenuAction: - - View - - YES - - - Show Toolbar - t - 1572864 - 2147483647 - - - - - - Customize Toolbar… - - 1048576 - 2147483647 - - - - - - - - - Window - - 1048576 - 2147483647 - - - submenuAction: - - Window - - YES - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Bring All to Front - - 1048576 - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 1048576 - 2147483647 - - - submenuAction: - - Help - - YES - - - NewApplication Help - ? - 1048576 - 2147483647 - - - - - - - - _NSMainMenu - - - 7 - 2 - {{335, 236}, {644, 514}} - 1946157056 - ASIHTTPRequest Examples - NSWindow - - - - - 256 - - YES - - - 1290 - - {{11, 16}, {151, 20}} - - - 16392 - 1 - - - - 12 - {{6, 35}, {625, 465}} - - - - - YES - - 1 - - - 256 - - YES - - - 268 - {{11, 301}, {62, 32}} - - - - YES - - 67239424 - 134217728 - Go! - - LucidaGrande - 13 - 1044 - - - -2038284033 - 129 - - - 200 - 25 - - - - - 268 - {{14, 348}, {577, 64}} - - - - YES - - 67239424 - 272629760 - Demonstrates fetching a web page synchronously, the HTML source will appear in the box below when the download is complete. Because this synchronous download is running in the main thread, the interface will lock until the download is complete. - - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - controlTextColor - - 3 - MAA - - - - - - - 282 - - YES - - - 2304 - - YES - - - 2322 - - YES - - YES - Apple HTML pasteboard type - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - Apple URL pasteboard type - CorePasteboardFlavorType 0x6D6F6F76 - NSColor pasteboard type - NSFilenamesPboardType - NSStringPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT RTFD pasteboard type - NeXT Rich Text Format v1.0 pasteboard type - NeXT TIFF v4.0 pasteboard type - NeXT font pasteboard type - NeXT ruler pasteboard type - WebURLsWithTitlesPboardType - public.url - - - {{0, 66}, {554, 14}} - - - - - - - - - - - - - YES - - - 6 - - - - 554 - 1 - - - 11239 - 0 - - - 3 - MQA - - - YES - - YES - NSBackgroundColor - NSColor - - - YES - - 6 - System - selectedTextBackgroundColor - - - - 6 - System - selectedTextColor - - - - - - - YES - - YES - NSColor - NSUnderline - - - YES - - 1 - MCAwIDEAA - - - - - - - 1 - - 6 - {807, 10000000} - {223, 0} - - - - {{1, 1}, {554, 281}} - - - - - - - {4, 5} - - 12582912 - - YES - - YES - - - - TU0AKgAAAHCAFUqgBVKsAAAAwdVQUqwaEQeIRGJRGFlYqwWLQ+JxuOQpVRmEx2RROKwOQyOUQSPyaUym -SxqWyKXyeYxyZzWbSuJTScRCbz2Nz+gRKhUOfTqeUai0OSxiWTiBQSHSGFquGwekxyAgAAAOAQAAAwAA -AAEAEAAAAQEAAwAAAAEAEAAAAQIAAwAAAAIACAAIAQMAAwAAAAEABQAAAQYAAwAAAAEAAQAAAREABAAA -AAEAAAAIARIAAwAAAAEAAQAAARUAAwAAAAEAAgAAARYAAwAAAAEAEAAAARcABAAAAAEAAABnARwAAwAA -AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA - - - - - - 3 - MCAwAA - - - - 4 - - - - 256 - {{555, 1}, {15, 281}} - - - - - _doScroller: - 0.9512195 - - - - -2147483392 - {{-100, -100}, {87, 18}} - - - - 1 - - _doScroller: - 1 - 0.94565220000000005 - - - {{17, 17}, {571, 283}} - - - - 133138 - - - - - - {{10, 33}, {605, 419}} - - - - - Synchronous - - - - - 2 - - - 256 - - YES - - - 268 - {{11, 274}, {74, 32}} - - YES - - 67239424 - 134217728 - Start - - - -2038284033 - 129 - - - 200 - 25 - - - - - 268 - {{85, 274}, {90, 32}} - - YES - - 604110336 - 134217728 - Resume - - - -2038284033 - 129 - - - 200 - 25 - - - - - 268 - {{14, 320}, {577, 92}} - - YES - - 67239424 - 272629760 - RGVtb25zdHJhdGVzIGZldGNoaW5nIGEgbGFyZ2UgZmlsZSBkaXJlY3RseSB0byBkaXNrLCB1cGRhdGlu -ZyB0aGUgcHJvZ3Jlc3MgYmFyIGJlbG93IHRvIHNob3cgaG93IG11Y2ggaGFzIGJlZW4gZG93bmxvYWRl -ZC4KCklmIHRoZSByZXF1ZXN0IGlzIHN0b3BwZWQgcGFydCB3YXkgdGhyb3VnaCwgdXNlIHRoZSByZXN1 -bWUgYnV0dG9uIHRvIHBpY2sgdXAgd2hlcmUgd2UgbGVmdCBvZmYuA - - - - - - - - - 268 - {{14, 215}, {553, 40}} - - YES - - 67239424 - 272629760 - The path to the file will appear here once the download is complete - - - - - - - - {{10, 33}, {605, 419}} - - File - - - - - Item 2 - - - 256 - - YES - - - 268 - - YES - - YES - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - NSFilenamesPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT TIFF v4.0 pasteboard type - - - {{14, 169}, {190, 130}} - - YES - - 130560 - 33554432 - 0 - 0 - 2 - NO - - YES - - - - 268 - - YES - - YES - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - NSFilenamesPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT TIFF v4.0 pasteboard type - - - {{207, 169}, {190, 130}} - - YES - - 130560 - 33554432 - 0 - 0 - 2 - NO - - YES - - - - 268 - - YES - - YES - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - NSFilenamesPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT TIFF v4.0 pasteboard type - - - {{401, 169}, {190, 130}} - - YES - - 130560 - 33554432 - 0 - 0 - 2 - NO - - YES - - - - 268 - {{10, 306}, {62, 32}} - - YES - - 67239424 - 134217728 - Go! - - - -2038284033 - 129 - - - 200 - 25 - - - - - 268 - {{14, 327}, {577, 85}} - - YES - - 67239424 - 272629760 - RGVtb25zdHJhdGVzIGEgZmV0Y2hpbmcgMyBpdGVtcyBhdCBvbmNlLCB1c2luZyBhbiBBU0lOZXR3b3Jr -UXVldWUgdG8gdHJhY2sgcHJvZ3Jlc3MuIEVhY2ggcmVxdWVzdCBoYXMgaXRzIGRvd25sb2FkUHJvZ3Jl -c3NEZWxlZ2F0ZSBzZXQgdG8gdGhlIHByb2dyZXNzIGluZGljYXRvciB1bmRlciB0aGUgaW1hZ2Ugdmll -dy4gVGhlIHF1ZXVlIG1hbmFnZXMgdGhlIG92ZXJhbGwgcHJvZ3Jlc3MgZGlzcGxheWVkIGF0IHRoZSBi -b3R0b20gb2YgdGhlIHdpbmRvdy4gCg - - - - - - - - - 268 - {{13, 17}, {577, 102}} - - YES - - 67239424 - 272629760 - V2hlbiBhY2N1cmF0ZSBwcm9ncmVzcyBpcyB0dXJuZWQgb2ZmLCBlYWNoIHJlcXVlc3Qgb25seSB1cGRh -dGVzIHByb2dyZXNzIHdoZW4gaXQgY29tcGxldGVzLiBUaGlzIG1lYW5zIHRoYXQgZWFjaCByZXF1ZXN0 -IGlzIHJlcHJlc2VudGVkIGJ5IHRoZSBzYW1lIGFtb3VudCBvZiBwcm9ncmVzcyBpbiB0aGUgcHJvZ3Jl -c3MgaW5kaWNhdG9yLgoKV2l0aCBhY2N1cmF0ZSBwcm9ncmVzcyB0dXJuZWQgb24sIHRoZSBxdWV1ZSB3 -aWxsIGZpcnN0IHBlcmZvcm0gYSBIRUFEIHJlcXVlc3QgZm9yIGVhY2ggaW1hZ2UgdG8gb2J0YWluIGl0 -cyBzaXplLiBSZXF1ZXN0cyB0aGVuIHVwZGF0ZSB0aGUgcHJvZ3Jlc3MgYXMgZGF0YSBpcyByZWNlaXZl -ZC4 - - - - - - - - - 268 - {{80, 315}, {172, 18}} - - YES - - 67239424 - 0 - Show accurate progress - - - 1211912703 - 2 - - NSImage - NSSwitch - - - NSSwitch - - - - 200 - 25 - - - - - 1292 - - {{16, 152}, {186, 12}} - - 16648 - 1 - - - - 1292 - - {{208, 152}, {187, 12}} - - 16648 - 1 - - - - 1292 - - {{403, 152}, {186, 12}} - - 16648 - 1 - - - - 268 - {{14, 129}, {190, 17}} - - YES - - 68288064 - 138413056 - This image is 15KB - - - - - - - - - 268 - {{206, 129}, {191, 17}} - - YES - - 68288064 - 138413056 - This image is 176KB - - - - - - - - - 268 - {{401, 129}, {185, 17}} - - YES - - 68288064 - 138413056 - This image is 1.4MB - - - - - - - - {{10, 33}, {605, 419}} - - Queue - - - - - Item 3 - - - 256 - - YES - - - 268 - {{14, 365}, {577, 47}} - - YES - - 67239424 - 272629760 - Demonstrates fetching content from an area that requires HTTP authentication. You will be prompted for a username and password, enter 'topsecret' for both. - - - - - - - - - 268 - {{11, 208}, {62, 32}} - - YES - - 67239424 - 134217728 - Go! - - - -2038284033 - 129 - - - 200 - 25 - - - - - 268 - {{15, 341}, {160, 18}} - - YES - - 67239424 - 0 - Use the Keychain - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 268 - {{14, 253}, {577, 68}} - - YES - - 67239424 - 272629760 - If you turn on keychain support, successful authentication will result in the username and password you provided being stored in your keychain. The application will use these details rather than prompt you the next time. - - - - - - - - - 268 - {{14, 181}, {413, 17}} - - YES - - 67239488 - 272630784 - Top secret information will not appear here. - - - - - - - - {{10, 33}, {605, 419}} - - Authentication - - - - - Item 4 - - - 256 - - YES - - - 268 - {{14, 381}, {577, 31}} - - YES - - 67239424 - 272629760 - Demonstrates POSTing content to a URL, showing upload progress. - - - - - - - - - 268 - {{11, 345}, {62, 32}} - - YES - - 67239424 - 134217728 - Go! - - - -2038284033 - 129 - - - 200 - 25 - - - - - 268 - {{14, 83}, {577, 256}} - - YES - - 67239424 - 272629760 - - - LucidaGrande - 13 - 16 - - - - - - - - {{10, 33}, {605, 419}} - - Upload - - - - - Item 5 - - - 256 - - YES - - - 268 - - YES - - - 2304 - - YES - - - 256 - {569, 269} - - YES - - - -2147483392 - {{224, 0}, {16, 17}} - - - YES - - image - 133 - 40 - 1000 - - 75628096 - 2048 - - - LucidaGrande - 11 - 3100 - - - 3 - MC4zMzMzMzI5ODU2AA - - - 6 - System - headerTextColor - - - - - 67239424 - 33554432 - - 0 - 0 - 0 - NO - - 3 - YES - YES - - - - 400 - 40 - 1000 - - 75628096 - 2048 - - - - - - - 67239424 - 4096 - Text Cell - - LucidaGrande - 11 - 16 - - - - 6 - System - controlBackgroundColor - - - - - 3 - YES - YES - - - - 3 - 2 - - 1 - MSAxIDEAA - - - 100 - 44040192 - - - 0 - 15 - 0 - NO - 0 - 1 - - - {{1, 1}, {569, 269}} - - - - - 4 - - - - -2147483392 - {{224, 17}, {15, 102}} - - - _doScroller: - 0.99591836734693873 - - - - -2147483392 - {{-100, -100}, {223, 15}} - - 1 - - _doScroller: - 0.57142859697341919 - - - {{17, 47}, {571, 271}} - - - 133650 - - - - QSAAAEEgAABCzAAAQswAAA - - - - 268 - {{14, 140}, {276, 17}} - - YES - - 68288064 - 272630784 - - - - - - - - - - 268 - {{434, 15}, {89, 25}} - - YES - - -2080244224 - 134217728 - Clear Cache - - - -2038152961 - 163 - - - 400 - 75 - - - - - 268 - {{531, 15}, {57, 25}} - - YES - - -2080244224 - 134217728 - Reload - - - -2038152961 - 163 - - - 400 - 75 - - - - - 268 - {{14, 326}, {577, 85}} - - YES - - 67239424 - 4194304 - The table view below is populated by downloading an XML file, then downloading the images from the URLs in the XML. The requests are configured to store their responses in the global ASIDownloadCache, and will re-use previously downloaded data if it exists rather than fetching it again. - - - - - - - - {{10, 33}, {605, 419}} - - Cache - - - - - Item 6 - - - 256 - - YES - - - 256 - - YES - - YES - Apple HTML pasteboard type - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple URL pasteboard type - Apple Web Archive pasteboard type - NSColor pasteboard type - NSFilenamesPboardType - NSStringPboardType - NeXT RTFD pasteboard type - NeXT Rich Text Format v1.0 pasteboard type - NeXT TIFF v4.0 pasteboard type - WebURLsWithTitlesPboardType - public.png - public.url - public.url-name - - - {{17, 85}, {571, 160}} - - - - - - - - YES - - YES - WebKitDefaultFixedFontSize - WebKitDefaultFontSize - WebKitMinimumFontSize - - - YES - - - - - - - YES - YES - - - - 268 - {{14, 344}, {577, 68}} - - - YES - - 67239424 - 4194304 - Demonstrates fetching a webpage with a single ASIWebPageRequest that downloads most external resources (images, stylesheets etc). These can be stored in a cache, or embeded directly in the HTML source. Once downloaded, a complete page may be cached indefinitely. - - - - - - - - - 268 - {{14, 315}, {480, 25}} - - - YES - - 67239424 - 4194304 - ASIWebPageRequest is an EXPERIMENTAL class, use at your own risk! - - LucidaGrande-Bold - 13 - 16 - - - - - - - - - 268 - {{536, 280}, {58, 32}} - - - YES - - 67239424 - 134217728 - Go - - - -2038284033 - 129 - - - 200 - 25 - - - - - 256 - - YES - - - 2304 - - YES - - - 2322 - {{0, -3}, {554, 14}} - - - - - - - HTML source will appear here - - - YES - - YES - NSFont - NSParagraphStyle - - - YES - - Monaco - 10 - 16 - - - 4 - - - - - - - - YES - - - 134 - - - - 554 - 1 - - - 12263 - 0 - - - - YES - - YES - NSBackgroundColor - NSColor - - - YES - - - - - - - YES - - YES - NSColor - NSCursor - NSUnderline - - - YES - - - {8, -8} - 13 - - - - - - - 1 - - 6 - {554, 10000000} - {223, 11} - - - - {{1, 1}, {554, 58}} - - - - - - 4 - - - - 256 - {{555, 1}, {15, 58}} - - - - _doScroller: - 1 - 0.85256409645080566 - - - - -2147483392 - {{-100, -100}, {87, 18}} - - - 1 - - _doScroller: - 1 - 0.94565218687057495 - - - {{17, 17}, {571, 60}} - - - 133138 - - - - - - - 268 - {{17, 286}, {517, 22}} - - - YES - - -1804468671 - 272630784 - http://allseeing-i.com/ASIHTTPRequest/tests/ASIWebPageRequest/index.html - - - YES - - 6 - System - textBackgroundColor - - - - 6 - System - textColor - - - - - - - 268 - {{15, 251}, {360, 18}} - - - YES - - -2080244224 - 0 - Embed external resources directly into HTML and CSS - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 268 - {{499, 251}, {89, 25}} - - - YES - - -2080244224 - 134217728 - Clear Cache - - - -2038152961 - 163 - - - 400 - 75 - - - - {{10, 33}, {605, 419}} - - - Web Page Fetch - - - - - - - 0 - YES - YES - - YES - - - - - - 268 - {{334, 20}, {293, 17}} - - - YES - - 68288064 - 71304192 - - - - - - - - - - 268 - {{171, 18}, {143, 18}} - - - YES - - 67239424 - 0 - Throttle bandwidth - - - 1211912703 - 2 - - - - - 200 - 25 - - - - {644, 514} - - - - {{0, 0}, {1440, 878}} - {10000000000000, 10000000000000} - YES - - - AppDelegate - - - 15 - 2 - {{196, 328}, {279, 182}} - 1677721600 - Window - NSWindow - - - - - 256 - - YES - - - 268 - {{17, 152}, {38, 17}} - - YES - - 67239488 - 272630784 - Host: - - - - - - - - - 268 - {{17, 120}, {47, 17}} - - YES - - 67239488 - 272630784 - Realm: - - - - - - - - - 268 - {{97, 152}, {165, 17}} - - YES - - 67239488 - 272630784 - host here - - - - - - - - - 268 - {{97, 120}, {165, 17}} - - YES - - 67239488 - 272630784 - realm here - - - - - - - - - 268 - {{17, 86}, {71, 17}} - - YES - - 67239488 - 272630784 - Username: - - - - - - - - - 268 - {{17, 53}, {71, 17}} - - YES - - 67239488 - 272630784 - Password: - - - - - - - - - 268 - {{100, 84}, {159, 22}} - - YES - - -1804468671 - 272630784 - - - - YES - - - - - - - 268 - {{100, 50}, {159, 22}} - - YES - - -1804468671 - 272630784 - - - - YES - - - - - - - 268 - {{14, 5}, {96, 32}} - - YES - - 67239424 - 134217728 - Cancel - - - -2038284033 - 129 - - Gw - 200 - 25 - - - - - 268 - {{169, 5}, {96, 32}} - - 1 - YES - - 67239424 - 134217728 - OK - - - -2038284033 - 129 - - DQ - 200 - 25 - - - - {279, 182} - - {{0, 0}, {1440, 878}} - {10000000000000, 10000000000000} - YES - - - - - YES - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - print: - - - - 86 - - - - runPageLayout: - - - - 87 - - - - clearRecentDocuments: - - - - 127 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - performClose: - - - - 193 - - - - toggleContinuousSpellChecking: - - - - 222 - - - - undo: - - - - 223 - - - - copy: - - - - 224 - - - - checkSpelling: - - - - 225 - - - - paste: - - - - 226 - - - - stopSpeaking: - - - - 227 - - - - cut: - - - - 228 - - - - showGuessPanel: - - - - 230 - - - - redo: - - - - 231 - - - - selectAll: - - - - 232 - - - - startSpeaking: - - - - 233 - - - - delete: - - - - 235 - - - - performZoom: - - - - 240 - - - - performFindPanelAction: - - - - 241 - - - - centerSelectionInVisibleArea: - - - - 245 - - - - toggleGrammarChecking: - - - - 347 - - - - toggleSmartInsertDelete: - - - - 355 - - - - toggleAutomaticQuoteSubstitution: - - - - 356 - - - - toggleAutomaticLinkDetection: - - - - 357 - - - - showHelp: - - - - 360 - - - - orderFrontColorPanel: - - - - 361 - - - - saveDocument: - - - - 362 - - - - saveDocumentAs: - - - - 363 - - - - revertDocumentToSaved: - - - - 364 - - - - runToolbarCustomizationPalette: - - - - 365 - - - - toggleToolbarShown: - - - - 366 - - - - hide: - - - - 367 - - - - hideOtherApplications: - - - - 368 - - - - terminate: - - - - 369 - - - - unhideAllApplications: - - - - 370 - - - - newDocument: - - - - 373 - - - - openDocument: - - - - 374 - - - - progressIndicator - - - - 385 - - - - loginWindow - - - - 414 - - - - window - - - - 415 - - - - host - - - - 416 - - - - realm - - - - 417 - - - - username - - - - 418 - - - - password - - - - 419 - - - - simpleURLFetch: - - - - 473 - - - - URLFetchWithProgress: - - - - 474 - - - - fetchThreeImages: - - - - 475 - - - - imageView1 - - - - 476 - - - - imageView2 - - - - 477 - - - - imageView3 - - - - 478 - - - - fileLocation - - - - 481 - - - - htmlSource - - - - 486 - - - - topSecretInfo - - - - 497 - - - - keychainCheckbox - - - - 498 - - - - fetchTopSecretInformation: - - - - 499 - - - - dismissAuthSheet: - - - - 500 - - - - dismissAuthSheet: - - - - 501 - - - - postWithProgress: - - - - 506 - - - - showAccurateProgress - - - - 515 - - - - resumeButton - - - - 522 - - - - startButton - - - - 523 - - - - resumeURLFetchWithProgress: - - - - 524 - - - - imageProgress1 - - - - 528 - - - - imageProgress2 - - - - 529 - - - - imageProgress3 - - - - 530 - - - - bandwidthUsed - - - - 537 - - - - throttleBandwidth: - - - - 542 - - - - postStatus - - - - 545 - - - - tableView - - - - 557 - - - - dataSource - - - - 558 - - - - delegate - - - - 559 - - - - delegate - - - - 560 - - - - tableLoadStatus - - - - 564 - - - - clearCache: - - - - 570 - - - - reloadTableData: - - - - 571 - - - - fetchWebPage: - - - - 589 - - - - webView - - - - 590 - - - - webPageSource - - - - 595 - - - - urlField - - - - 598 - - - - policyDelegate - - - - 600 - - - - dataURICheckbox - - - - 605 - - - - clearCache: - - - - 609 - - - - clearCache: - - - - 612 - - - - - YES - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - YES - - - - - - - - - - MainMenu - - - 19 - - - YES - - - - - - 56 - - - YES - - - - - - 103 - - - YES - - - - 1 - - - 217 - - - YES - - - - - - 83 - - - YES - - - - - - 81 - - - YES - - - - - - - - - - - - - - - - 75 - - - 3 - - - 80 - - - 8 - - - 78 - - - 6 - - - 72 - - - - - 82 - - - 9 - - - 124 - - - YES - - - - - - 77 - - - 5 - - - 73 - - - 1 - - - 79 - - - 7 - - - 112 - - - 10 - - - 74 - - - 2 - - - 125 - - - YES - - - - - - 126 - - - - - 205 - - - YES - - - - - - - - - - - - - - - - - - 202 - - - - - 198 - - - - - 207 - - - - - 214 - - - - - 199 - - - - - 203 - - - - - 197 - - - - - 206 - - - - - 215 - - - - - 218 - - - YES - - - - - - 216 - - - YES - - - - - - 200 - - - YES - - - - - - - - - 219 - - - - - 201 - - - - - 204 - - - - - 220 - - - YES - - - - - - - - - - 213 - - - - - 210 - - - - - 221 - - - - - 208 - - - - - 209 - - - - - 106 - - - YES - - - - 2 - - - 111 - - - - - 57 - - - YES - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - 1111 - - - 144 - - - - - 129 - - - 121 - - - 143 - - - - - 236 - - - - - 131 - - - YES - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - YES - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 295 - - - YES - - - - - - 296 - - - YES - - - - - - - 297 - - - - - 298 - - - - - 299 - - - YES - - - - - - 300 - - - YES - - - - - - - 344 - - - - - 345 - - - - - 211 - - - YES - - - - - - 212 - - - YES - - - - - - - 195 - - - - - 196 - - - - - 346 - - - - - 348 - - - YES - - - - - - 349 - - - YES - - - - - - - - 350 - - - - - 351 - - - - - 354 - - - - - 371 - - - YES - - - - - - 372 - - - YES - - - - - - - - - 381 - - - - - 384 - - - - - 390 - - - YES - - - - - - 391 - - - YES - - - - - - - - - - - - - - - 392 - - - YES - - - - - - 393 - - - - - 394 - - - YES - - - - - - 395 - - - - - 398 - - - YES - - - - - - 399 - - - - - 400 - - - YES - - - - - - 401 - - - - - 402 - - - YES - - - - - - 403 - - - - - 404 - - - YES - - - - - - 405 - - - - - 406 - - - YES - - - - - - 407 - - - - - 408 - - - YES - - - - - - 409 - - - - - 410 - - - YES - - - - - - 411 - - - - - 412 - - - YES - - - - - - 413 - - - - - 434 - - - YES - - - - - - - - - - - - 436 - - - YES - - - - - - 437 - - - YES - - - - - - - - - 439 - - - YES - - - - - - 440 - - - YES - - - - - - - - - - - - - - - - - - 441 - - - YES - - - - - - 442 - - - YES - - - - - - - - - - 443 - - - YES - - - - - - 444 - - - YES - - - - - - - - 451 - - - YES - - - - - - 452 - - - YES - - - - - - 453 - - - YES - - - - - - 454 - - - - - 455 - - - - - 456 - - - - - 459 - - - YES - - - - - - 460 - - - - - 461 - - - YES - - - - - - 462 - - - - - 467 - - - YES - - - - - - 468 - - - - - 469 - - - YES - - - - - - 470 - - - - - 479 - - - YES - - - - - - 480 - - - - - 435 - - - YES - - - - - - 438 - - - YES - - - - - - - - 471 - - - YES - - - - - - 472 - - - - - 457 - - - YES - - - - - - 458 - - - - - 482 - - - YES - - - - - - - - 483 - - - - - 484 - - - - - 485 - - - - - 487 - - - YES - - - - - - 488 - - - YES - - - - - - 489 - - - - - 490 - - - - - 491 - - - YES - - - - - - 492 - - - - - 493 - - - YES - - - - - - 494 - - - - - 495 - - - YES - - - - - - 496 - - - - - 502 - - - YES - - - - - - 503 - - - - - 504 - - - YES - - - - - - 505 - - - - - 513 - - - YES - - - - - - 514 - - - - - 520 - - - YES - - - - - - 521 - - - - - 525 - - - - - 526 - - - - - 527 - - - - - 535 - - - YES - - - - - - 536 - - - - - 540 - - - YES - - - - - - 541 - - - - - 543 - - - YES - - - - - - 544 - - - - - 546 - - - YES - - - - - - 547 - - - YES - - - - - - - - - - 548 - - - YES - - - - - - - - 549 - - - - - 550 - - - - - 551 - - - YES - - - - - - - 553 - - - YES - - - - - - 554 - - - YES - - - - - - 555 - - - - - 561 - - - - - 562 - - - YES - - - - - - 563 - - - - - 566 - - - YES - - - - - - 567 - - - - - 568 - - - YES - - - - - - 569 - - - - - 572 - - - YES - - - - - - 573 - - - - - 574 - - - YES - - - - - - 575 - - - YES - - - - - - - - - - - - - 576 - - - YES - - - - - - 577 - - - - - 578 - - - YES - - - - - - 579 - - - - - 580 - - - YES - - - - - - 581 - - - - - 582 - - - - - 583 - - - YES - - - - - - 584 - - - - - 585 - - - YES - - - - - - 586 - - - - - 587 - - - YES - - - - - - 588 - - - - - 591 - - - YES - - - - - - - - 592 - - - - - 593 - - - - - 594 - - - - - 596 - - - YES - - - - - - 597 - - - - - 603 - - - YES - - - - - - 604 - - - - - 606 - - - YES - - - - - - 607 - - - - - 610 - - - YES - - - - - - 611 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 103.IBPluginDependency - 106.IBPluginDependency - 111.IBPluginDependency - 112.IBPluginDependency - 124.IBPluginDependency - 125.IBPluginDependency - 126.IBPluginDependency - 129.IBPluginDependency - 130.IBPluginDependency - 131.IBPluginDependency - 134.IBPluginDependency - 136.IBPluginDependency - 143.IBPluginDependency - 144.IBPluginDependency - 145.IBPluginDependency - 149.IBPluginDependency - 150.IBPluginDependency - 19.IBPluginDependency - 195.IBPluginDependency - 196.IBPluginDependency - 197.IBPluginDependency - 198.IBPluginDependency - 199.IBPluginDependency - 200.IBPluginDependency - 201.IBPluginDependency - 202.IBPluginDependency - 203.IBPluginDependency - 204.IBPluginDependency - 205.IBPluginDependency - 206.IBPluginDependency - 207.IBPluginDependency - 208.IBPluginDependency - 209.IBPluginDependency - 210.IBPluginDependency - 211.IBPluginDependency - 212.IBPluginDependency - 213.IBPluginDependency - 214.IBPluginDependency - 215.IBPluginDependency - 216.IBPluginDependency - 217.IBPluginDependency - 218.IBPluginDependency - 219.IBPluginDependency - 220.IBPluginDependency - 221.IBPluginDependency - 23.IBPluginDependency - 236.IBPluginDependency - 239.IBPluginDependency - 24.IBPluginDependency - 29.IBPluginDependency - 295.IBPluginDependency - 296.IBPluginDependency - 297.IBPluginDependency - 298.IBPluginDependency - 299.IBPluginDependency - 300.IBPluginDependency - 344.IBPluginDependency - 345.IBPluginDependency - 346.IBPluginDependency - 348.IBPluginDependency - 349.IBPluginDependency - 350.IBPluginDependency - 351.IBPluginDependency - 354.IBPluginDependency - 371.IBPluginDependency - 371.IBWindowTemplateEditedContentRect - 371.NSWindowTemplate.visibleAtLaunch - 372.IBPluginDependency - 381.IBPluginDependency - 384.IBPluginDependency - 390.IBPluginDependency - 390.IBWindowTemplateEditedContentRect - 390.NSWindowTemplate.visibleAtLaunch - 391.IBPluginDependency - 392.IBPluginDependency - 393.IBPluginDependency - 394.IBPluginDependency - 395.IBPluginDependency - 398.IBPluginDependency - 399.IBPluginDependency - 400.IBPluginDependency - 401.IBPluginDependency - 402.IBPluginDependency - 403.IBPluginDependency - 404.IBPluginDependency - 405.IBPluginDependency - 406.IBPluginDependency - 407.IBPluginDependency - 408.IBPluginDependency - 409.IBPluginDependency - 410.IBPluginDependency - 411.IBPluginDependency - 412.IBPluginDependency - 413.IBPluginDependency - 434.IBPluginDependency - 435.IBPluginDependency - 436.IBPluginDependency - 437.IBPluginDependency - 438.IBPluginDependency - 439.IBPluginDependency - 440.IBPluginDependency - 441.IBPluginDependency - 442.IBPluginDependency - 443.IBPluginDependency - 444.IBPluginDependency - 451.IBPluginDependency - 452.IBPluginDependency - 453.IBPluginDependency - 454.IBPluginDependency - 455.IBPluginDependency - 456.IBPluginDependency - 457.IBPluginDependency - 458.IBPluginDependency - 459.IBPluginDependency - 460.IBPluginDependency - 461.IBPluginDependency - 462.IBPluginDependency - 467.IBPluginDependency - 468.IBPluginDependency - 469.IBPluginDependency - 470.IBPluginDependency - 471.IBPluginDependency - 472.IBPluginDependency - 479.IBPluginDependency - 480.IBPluginDependency - 482.IBPluginDependency - 483.IBPluginDependency - 484.IBPluginDependency - 485.IBPluginDependency - 487.IBPluginDependency - 488.IBPluginDependency - 489.IBPluginDependency - 490.IBPluginDependency - 491.IBPluginDependency - 492.IBPluginDependency - 493.IBPluginDependency - 494.IBPluginDependency - 495.IBPluginDependency - 496.IBPluginDependency - 5.IBPluginDependency - 502.IBPluginDependency - 503.IBPluginDependency - 504.IBPluginDependency - 505.IBPluginDependency - 513.IBPluginDependency - 514.IBPluginDependency - 520.IBPluginDependency - 521.IBPluginDependency - 525.IBPluginDependency - 526.IBPluginDependency - 527.IBPluginDependency - 535.IBPluginDependency - 536.IBPluginDependency - 540.IBPluginDependency - 541.IBPluginDependency - 543.IBPluginDependency - 544.IBPluginDependency - 546.IBPluginDependency - 547.IBPluginDependency - 548.IBPluginDependency - 549.IBPluginDependency - 550.IBPluginDependency - 551.IBPluginDependency - 553.IBPluginDependency - 554.IBPluginDependency - 555.IBPluginDependency - 56.IBPluginDependency - 561.IBPluginDependency - 562.IBPluginDependency - 563.IBPluginDependency - 566.IBPluginDependency - 567.IBPluginDependency - 568.IBPluginDependency - 569.IBPluginDependency - 57.IBPluginDependency - 572.IBPluginDependency - 573.IBPluginDependency - 574.IBPluginDependency - 575.IBPluginDependency - 576.IBPluginDependency - 577.IBPluginDependency - 578.IBPluginDependency - 579.IBPluginDependency - 58.IBPluginDependency - 580.IBPluginDependency - 581.IBPluginDependency - 582.IBPluginDependency - 583.IBPluginDependency - 584.IBPluginDependency - 585.IBPluginDependency - 586.IBPluginDependency - 587.IBPluginDependency - 588.IBPluginDependency - 591.IBPluginDependency - 592.IBPluginDependency - 593.IBPluginDependency - 594.IBPluginDependency - 596.IBPluginDependency - 597.IBPluginDependency - 603.IBPluginDependency - 604.IBPluginDependency - 606.IBPluginDependency - 607.IBPluginDependency - 610.IBPluginDependency - 611.IBPluginDependency - 72.IBPluginDependency - 73.IBPluginDependency - 74.IBPluginDependency - 75.IBPluginDependency - 77.IBPluginDependency - 78.IBPluginDependency - 79.IBPluginDependency - 80.IBPluginDependency - 81.IBPluginDependency - 82.IBPluginDependency - 83.IBPluginDependency - 92.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{468, 239}, {644, 514}} - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{329, 629}, {279, 182}} - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.WebKitIBPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - YES - - - - - - YES - - - - - 612 - - - - YES - - AppDelegate - NSObject - - YES - - YES - URLFetchWithProgress: - clearCache: - dismissAuthSheet: - fetchThreeImages: - fetchTopSecretInformation: - fetchWebPage: - postWithProgress: - reloadTableData: - resumeURLFetchWithProgress: - simpleURLFetch: - stopURLFetchWithProgress: - throttleBandwidth: - - - YES - id - id - id - id - id - id - id - id - id - id - id - id - - - - YES - - YES - URLFetchWithProgress: - clearCache: - dismissAuthSheet: - fetchThreeImages: - fetchTopSecretInformation: - fetchWebPage: - postWithProgress: - reloadTableData: - resumeURLFetchWithProgress: - simpleURLFetch: - stopURLFetchWithProgress: - throttleBandwidth: - - - YES - - URLFetchWithProgress: - id - - - clearCache: - id - - - dismissAuthSheet: - id - - - fetchThreeImages: - id - - - fetchTopSecretInformation: - id - - - fetchWebPage: - id - - - postWithProgress: - id - - - reloadTableData: - id - - - resumeURLFetchWithProgress: - id - - - simpleURLFetch: - id - - - stopURLFetchWithProgress: - id - - - throttleBandwidth: - id - - - - - YES - - YES - bandwidthUsed - dataURICheckbox - fileLocation - host - htmlSource - imageProgress1 - imageProgress2 - imageProgress3 - imageView1 - imageView2 - imageView3 - keychainCheckbox - loginWindow - password - postStatus - progressIndicator - realm - resumeButton - showAccurateProgress - startButton - tableLoadStatus - tableView - topSecretInfo - urlField - username - webPageSource - webView - window - - - YES - NSTextField - NSButton - NSTextField - NSTextField - NSTextView - NSProgressIndicator - NSProgressIndicator - NSProgressIndicator - NSImageView - NSImageView - NSImageView - NSButton - NSWindow - NSTextField - NSTextField - NSProgressIndicator - NSTextField - NSButton - NSButton - NSButton - NSTextField - NSTableView - NSTextField - NSTextField - NSTextField - NSTextView - WebView - NSWindow - - - - YES - - YES - bandwidthUsed - dataURICheckbox - fileLocation - host - htmlSource - imageProgress1 - imageProgress2 - imageProgress3 - imageView1 - imageView2 - imageView3 - keychainCheckbox - loginWindow - password - postStatus - progressIndicator - realm - resumeButton - showAccurateProgress - startButton - tableLoadStatus - tableView - topSecretInfo - urlField - username - webPageSource - webView - window - - - YES - - bandwidthUsed - NSTextField - - - dataURICheckbox - NSButton - - - fileLocation - NSTextField - - - host - NSTextField - - - htmlSource - NSTextView - - - imageProgress1 - NSProgressIndicator - - - imageProgress2 - NSProgressIndicator - - - imageProgress3 - NSProgressIndicator - - - imageView1 - NSImageView - - - imageView2 - NSImageView - - - imageView3 - NSImageView - - - keychainCheckbox - NSButton - - - loginWindow - NSWindow - - - password - NSTextField - - - postStatus - NSTextField - - - progressIndicator - NSProgressIndicator - - - realm - NSTextField - - - resumeButton - NSButton - - - showAccurateProgress - NSButton - - - startButton - NSButton - - - tableLoadStatus - NSTextField - - - tableView - NSTableView - - - topSecretInfo - NSTextField - - - urlField - NSTextField - - - username - NSTextField - - - webPageSource - NSTextView - - - webView - WebView - - - window - NSWindow - - - - - IBProjectSource - ./Classes/AppDelegate.h - - - - BWSplitView - NSSplitView - - toggleCollapse: - id - - - toggleCollapse: - - toggleCollapse: - id - - - - IBProjectSource - ./Classes/BWSplitView.h - - - - GHTestViewController - NSViewController - - YES - - YES - copy: - openExceptionFilename: - rerunTest: - runTests: - toggleDetails: - updateMode: - updateSearchFilter: - updateTextSegment: - - - YES - id - id - id - id - id - id - id - id - - - - YES - - YES - copy: - openExceptionFilename: - rerunTest: - runTests: - toggleDetails: - updateMode: - updateSearchFilter: - updateTextSegment: - - - YES - - copy: - id - - - openExceptionFilename: - id - - - rerunTest: - id - - - runTests: - id - - - toggleDetails: - id - - - updateMode: - id - - - updateSearchFilter: - id - - - updateTextSegment: - id - - - - - YES - - YES - _detailsView - _outlineView - _searchField - _segmentedControl - _splitView - _statusView - _textSegmentedControl - _textView - - - YES - NSView - NSOutlineView - NSSearchField - NSSegmentedControl - BWSplitView - NSView - NSSegmentedControl - NSTextView - - - - YES - - YES - _detailsView - _outlineView - _searchField - _segmentedControl - _splitView - _statusView - _textSegmentedControl - _textView - - - YES - - _detailsView - NSView - - - _outlineView - NSOutlineView - - - _searchField - NSSearchField - - - _segmentedControl - NSSegmentedControl - - - _splitView - BWSplitView - - - _statusView - NSView - - - _textSegmentedControl - NSSegmentedControl - - - _textView - NSTextView - - - - - IBProjectSource - ./Classes/GHTestViewController.h - - - - GHTestWindowController - NSWindowController - - YES - - YES - copy: - runTests: - - - YES - id - id - - - - YES - - YES - copy: - runTests: - - - YES - - copy: - id - - - runTests: - id - - - - - viewController - GHTestViewController - - - viewController - - viewController - GHTestViewController - - - - IBProjectSource - ./Classes/GHTestWindowController.h - - - - NSDocument - - YES - - YES - printDocument: - revertDocumentToSaved: - runPageLayout: - saveDocument: - saveDocumentAs: - saveDocumentTo: - - - YES - id - id - id - id - id - id - - - - YES - - YES - printDocument: - revertDocumentToSaved: - runPageLayout: - saveDocument: - saveDocumentAs: - saveDocumentTo: - - - YES - - printDocument: - id - - - revertDocumentToSaved: - id - - - runPageLayout: - id - - - saveDocument: - id - - - saveDocumentAs: - id - - - saveDocumentTo: - id - - - - - IBProjectSource - ./Classes/NSDocument.h - - - - WebView - - reloadFromOrigin: - id - - - reloadFromOrigin: - - reloadFromOrigin: - id - - - - IBProjectSource - ./Classes/WebView.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - NSMenuCheckmark - NSMenuMixedState - NSSwitch - - - YES - {9, 8} - {7, 2} - {15, 15} - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Demonstrates fetching a web page synchronously, the HTML source will appear in the box below when the download is complete. Because this synchronous download is running in the main thread, the interface will lock until the download is complete. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Demonstrates fetching a large file directly to disk, updating the progress bar below to show how much has been downloaded. + +If the request is stopped part way through, use the resume button to pick up where we left off. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Demonstrates a fetching 3 items at once, using an ASINetworkQueue to track progress. Each request has its downloadProgressDelegate set to the progress indicator under the image view. The queue manages the overall progress displayed at the bottom of the window. + + + + + + + + + + + When accurate progress is turned off, each request only updates progress when it completes. This means that each request is represented by the same amount of progress in the progress indicator. + +With accurate progress turned on, the queue will first perform a HEAD request for each image to obtain its size. Requests then update the progress as data is received. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Demonstrates fetching content from an area that requires HTTP authentication. You will be prompted for a username and password, enter 'topsecret' for both. + + + + + + + + + + + + If you turn on keychain support, successful authentication will result in the username and password you provided being stored in your keychain. The application will use these details rather than prompt you the next time. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The table view below is populated by downloading an XML file, then downloading the images from the URLs in the XML. The requests are configured to store their responses in the global ASIDownloadCache, and will re-use previously downloaded data if it exists rather than fetching it again. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Demonstrates fetching a webpage with a single ASIWebPageRequest that downloads most external resources (images, stylesheets etc). These can be stored in a cache, or embeded directly in the HTML source. Once downloaded, a complete page may be cached indefinitely. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mac.xcodeproj/project.pbxproj b/Mac.xcodeproj/project.pbxproj index d6fa1b47..68db94b8 100644 --- a/Mac.xcodeproj/project.pbxproj +++ b/Mac.xcodeproj/project.pbxproj @@ -62,7 +62,7 @@ B5B513860FBEE515002C74D0 /* GHUnitTestMain.m in Sources */ = {isa = PBXBuildFile; fileRef = B5B513850FBEE515002C74D0 /* GHUnitTestMain.m */; }; B5BF64E612FDE9CA00CBC324 /* GHUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5BF64E512FDE9C900CBC324 /* GHUnit.framework */; }; B5C664BC100A6220004F3C96 /* ASIS3RequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B5C664BB100A6220004F3C96 /* ASIS3RequestTests.m */; }; - B5ED5A9412FEBAEC00A12511 /* GHUnit.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B5BF64E512FDE9C900CBC324 /* GHUnit.framework */; }; + B5ED5A9412FEBAEC00A12511 /* GHUnit.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B5BF64E512FDE9C900CBC324 /* GHUnit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -443,7 +443,7 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0420; + LastUpgradeCheck = 0610; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Mac" */; compatibilityVersion = "Xcode 3.2"; @@ -599,7 +599,7 @@ baseConfigurationReference = B515507810BD56E800608267 /* strict.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)/External/GHUnit\""; GCC_C_LANGUAGE_STANDARD = "compiler-default"; @@ -631,7 +631,7 @@ baseConfigurationReference = B515507810BD56E800608267 /* strict.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)/External/GHUnit\""; @@ -661,9 +661,9 @@ baseConfigurationReference = B515507810BD56E800608267 /* strict.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_DYNAMIC_NO_PIC = NO; @@ -676,7 +676,7 @@ HEADER_SEARCH_PATHS = "${SDK_DIR}/usr/include/libxml2"; INFOPLIST_FILE = "Mac Sample/Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; - MACOSX_DEPLOYMENT_TARGET = 10.5; + MACOSX_DEPLOYMENT_TARGET = 10.6; PRODUCT_NAME = Mac; SDKROOT = macosx; }; @@ -687,9 +687,9 @@ baseConfigurationReference = B515507810BD56E800608267 /* strict.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; + COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_ENABLE_OBJC_GC = unsupported; @@ -699,7 +699,7 @@ HEADER_SEARCH_PATHS = "${SDK_DIR}/usr/include/libxml2"; INFOPLIST_FILE = "Mac Sample/Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; - MACOSX_DEPLOYMENT_TARGET = 10.5; + MACOSX_DEPLOYMENT_TARGET = 10.6; PRODUCT_NAME = Mac; SDKROOT = macosx; }; @@ -708,7 +708,6 @@ C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -722,7 +721,6 @@ C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; diff --git a/README.textile b/README.markdown similarity index 90% rename from README.textile rename to README.markdown index 7fe1f908..c14d68bd 100644 --- a/README.textile +++ b/README.markdown @@ -2,31 +2,100 @@ ASIHTTPRequest is an easy to use wrapper around the CFNetwork API that makes som It is suitable performing basic HTTP requests and interacting with REST-based services (GET / POST / PUT / DELETE). The included ASIFormDataRequest subclass makes it easy to submit POST data and files using multipart/form-data. -It provides: +####It provides: + * A straightforward interface for submitting data to and fetching data from webservers + + * Download data to memory or directly to a file on disk + + * Submit files on local drives as part of POST data, compatible with the HTML file input mechanism + + + * Stream request bodies directly from disk to the server, to conserve memory + + + * Resume for partial downloads + + * Easy access to request and response HTTP headers + + + * Progress delegates (NSProgressIndicators and UIProgressViews) to show information about download AND upload progress + + + * Auto-magic management of upload and download progress indicators for operation queues + + + * Basic, Digest + NTLM authentication support, credentials are automatically re-used for the duration of a session, and can be stored for later in the Keychain. + + + * Cookie support + + + * [NEW] Requests can continue to run when your app moves to the background (iOS 4+) + + + * GZIP support for response data AND request bodies + + + * The included ASIDownloadCache class lets requests transparently cache responses, and allow requests for cached data to succeed even when there is no network available + + + * [NEW] ASIWebPageRequest - download complete webpages, including external resources like images and stylesheets. Pages of any size can be indefinitely cached, and displayed in a UIWebview / WebView even when you have no network connection. + + + * Easy to use support for Amazon S3 - no need to fiddle around signing requests yourself! + + + * Full support for Rackspace Cloud Files + + + * [NEW] Client certificates support + + + * Supports manual and auto-detected proxies, authenticating proxies, and PAC file auto-configuration. The built-in login dialog lets your iPhone application work transparently with authenticating proxies without any additional effort. + + + * Bandwidth throttling support + + + * Support for persistent connections + + + * Supports synchronous & asynchronous requests + + + * Get notifications about changes in your request state via delegation or [NEW] blocks (Mac OS X 10.6, iOS 4 and above) + + + * Comes with a broad range of unit tests -ASIHTTPRequest is compatible with Mac OS 10.5 or later, and iOS 3.0 or later. -Documentation is available "here":http://allseeing-i.com/ASIHTTPRequest. \ No newline at end of file + + + + +ASIHTTPRequest is compatible with Mac OS 32/64bit on 10.6 or later, and iOS 5.1.1 or later. + +Documentation is available [here](http://allseeing-i.com/ASIHTTPRequest). diff --git a/iPhone Sample/InfoCell.m b/iPhone Sample/InfoCell.m index 31f95f9d..62be96fc 100644 --- a/iPhone Sample/InfoCell.m +++ b/iPhone Sample/InfoCell.m @@ -33,8 +33,8 @@ + (id)cell - (void)layoutSubviews { [super layoutSubviews]; - int tablePadding = 40; - int tableWidth = [[self superview] frame].size.width; + CGFloat tablePadding = 40; + CGFloat tableWidth = [[self superview] frame].size.width; if (tableWidth > 480) { // iPad tablePadding = 110; [[self textLabel] setFrame:CGRectMake(70,10,tableWidth-tablePadding-70,[[self class] neededHeightForDescription:[[self textLabel] text] withTableWidth:tableWidth])]; @@ -46,8 +46,8 @@ - (void)layoutSubviews + (NSUInteger)neededHeightForDescription:(NSString *)description withTableWidth:(NSUInteger)tableWidth { - int tablePadding = 40; - int offset = 0; + CGFloat tablePadding = 40; + CGFloat offset = 0; int textSize = 13; if (tableWidth > 480) { // iPad tablePadding = 110; diff --git a/iPhone Sample/QueueViewController.m b/iPhone Sample/QueueViewController.m index 27d5f8a5..e746439f 100644 --- a/iPhone Sample/QueueViewController.m +++ b/iPhone Sample/QueueViewController.m @@ -139,8 +139,8 @@ - (UIView *)tableView:(UITableView *)theTableView viewForHeaderInSection:(NSInte - (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - int tablePadding = 40; - int tableWidth = [tableView frame].size.width; + CGFloat tablePadding = 40; + CGFloat tableWidth = [tableView frame].size.width; if (tableWidth > 480) { // iPad tablePadding = 110; } @@ -264,8 +264,8 @@ - (CGFloat)tableView:(UITableView *)theTableView heightForRowAtIndexPath:(NSInde if ([indexPath section] == 0) { return [InfoCell neededHeightForDescription:intro withTableWidth:[tableView frame].size.width]+20; } else if ([indexPath section] == 2) { - int tablePadding = 40; - int tableWidth = [tableView frame].size.width; + CGFloat tablePadding = 40; + CGFloat tableWidth = [tableView frame].size.width; if (tableWidth > 480) { // iPad tablePadding = 110; } diff --git a/iPhone Sample/Resources/Default-568h@2x.png b/iPhone Sample/Resources/Default-568h@2x.png new file mode 100644 index 00000000..0891b7aa Binary files /dev/null and b/iPhone Sample/Resources/Default-568h@2x.png differ diff --git a/iPhone Sample/SynchronousViewController.m b/iPhone Sample/SynchronousViewController.m index 2c5c72ee..b7d2d6a9 100644 --- a/iPhone Sample/SynchronousViewController.m +++ b/iPhone Sample/SynchronousViewController.m @@ -116,7 +116,7 @@ - (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath if (!cell) { cell = [DetailCell cell]; } - NSString *key = [[[request responseHeaders] allKeys] objectAtIndex:[indexPath row]]; + NSString *key = [[[request responseHeaders] allKeys] objectAtIndex:(NSUInteger)[indexPath row]]; [[cell textLabel] setText:key]; [[cell detailTextLabel] setText:[[request responseHeaders] objectForKey:key]]; } @@ -127,7 +127,7 @@ - (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath - (NSInteger)tableView:(UITableView *)theTableView numberOfRowsInSection:(NSInteger)section { if (section == 3) { - return [[request responseHeaders] count]; + return (NSInteger)[[request responseHeaders] count]; } else { return 1; } diff --git a/iPhone Sample/WebPageViewController.m b/iPhone Sample/WebPageViewController.m index db982dc7..4b916026 100644 --- a/iPhone Sample/WebPageViewController.m +++ b/iPhone Sample/WebPageViewController.m @@ -118,9 +118,9 @@ - (void)requestFinished:(ASIWebPageRequest *)theRequest - (void)request:(ASIHTTPRequest *)theRequest didReceiveBytes:(long long)newLength { - NSInteger requestNumber = [[self requestsInProgress] indexOfObject:theRequest]; + NSUInteger requestNumber = [[self requestsInProgress] indexOfObject:theRequest]; if (requestNumber != NSNotFound) { - RequestProgressCell *cell = (RequestProgressCell *)[[self tableView] cellForRowAtIndexPath:[NSIndexPath indexPathForRow:requestNumber inSection:2]]; + RequestProgressCell *cell = (RequestProgressCell *)[[self tableView] cellForRowAtIndexPath:[NSIndexPath indexPathForRow:(NSInteger)requestNumber inSection:2]]; if ([theRequest contentLength]+[theRequest partialDownloadSize] > 0) { float progressAmount = (float)(([theRequest totalBytesRead]*1.0)/(([theRequest contentLength]+[theRequest partialDownloadSize])*1.0)); [[cell progressView] setProgress:progressAmount]; @@ -214,7 +214,7 @@ - (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath if (!cell) { cell = [RequestProgressCell cell]; } - ASIHTTPRequest *theRequest = [[self requestsInProgress] objectAtIndex:[indexPath row]]; + ASIHTTPRequest *theRequest = [[self requestsInProgress] objectAtIndex:(NSUInteger)[indexPath row]]; if ([theRequest didUseCachedResponse]) { [[cell textLabel] setText:[NSString stringWithFormat:@"Cached: %@",[[theRequest url] absoluteString]]]; [[cell accessoryView] setHidden:YES]; @@ -285,7 +285,7 @@ - (NSInteger)tableView:(UITableView *)theTableView numberOfRowsInSection:(NSInte if (section == 1) { return 2; } else if (section == 2) { - return [requestsInProgress count]; + return (NSInteger)[requestsInProgress count]; } return 1; } diff --git a/iPhone.xcodeproj/project.pbxproj b/iPhone.xcodeproj/project.pbxproj index 704320fe..611d8112 100644 --- a/iPhone.xcodeproj/project.pbxproj +++ b/iPhone.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + B17A07941A84C25800537003 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B17A07931A84C25800537003 /* Default-568h@2x.png */; }; + B17A07951A84C32000537003 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B17A07931A84C25800537003 /* Default-568h@2x.png */; }; B50C1823121C26DB0055FCAB /* ClientCertificateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B50C1822121C26DB0055FCAB /* ClientCertificateTests.m */; }; B50C182C121C26FA0055FCAB /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B50C182B121C26FA0055FCAB /* Security.framework */; }; B50C1848121C27510055FCAB /* client.p12 in Resources */ = {isa = PBXBuildFile; fileRef = B50C1847121C27510055FCAB /* client.p12 */; }; @@ -143,6 +145,7 @@ /* Begin PBXFileReference section */ 1D6058910D05DD3D006BFB54 /* ASIHTTPRequest iPhone.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ASIHTTPRequest iPhone.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + B17A07931A84C25800537003 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "iPhone Sample/Resources/Default-568h@2x.png"; sourceTree = ""; }; B50C1821121C26DB0055FCAB /* ClientCertificateTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientCertificateTests.h; sourceTree = ""; }; B50C1822121C26DB0055FCAB /* ClientCertificateTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ClientCertificateTests.m; sourceTree = ""; }; B50C182B121C26FA0055FCAB /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; @@ -405,6 +408,7 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + B17A07931A84C25800537003 /* Default-568h@2x.png */, B52325AC11CA05A8006C6E5A /* info.png */, B558B58911C7F637009B4627 /* iPhoneInfo.plist */, B558B58B11C7F63E009B4627 /* iPadInfo.plist */, @@ -647,6 +651,7 @@ B55B60740F765A990064029C /* iphone-icon.png in Resources */, B576D76611C7F4D90059B815 /* iPhoneMainWindow.xib in Resources */, B523254311CA01F1006C6E5A /* Sample.xib in Resources */, + B17A07941A84C25800537003 /* Default-568h@2x.png in Resources */, B50F661A1297FA45003887B1 /* strict.xcconfig in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -655,6 +660,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + B17A07951A84C32000537003 /* Default-568h@2x.png in Resources */, B56529A3101C8EDA000499CF /* iphone-tests-icon.png in Resources */, B50C1848121C27510055FCAB /* client.p12 in Resources */, B50F661B1297FA45003887B1 /* strict.xcconfig in Resources */, @@ -837,10 +843,10 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "iPhone Sample/iPhone_Prefix.pch"; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_VERSION = ""; 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; @@ -857,10 +863,10 @@ COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "iPhone Sample/iPhone_Prefix.pch"; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_VERSION = ""; 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; @@ -884,10 +890,10 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "iPhone Sample/iPhone_Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_VERSION = ""; HEADER_SEARCH_PATHS = "${SDK_DIR}/usr/include/libxml2"; INFOPLIST_FILE = "iPhone Sample/Tests-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 3.2.2; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; LIBRARY_SEARCH_PATHS = ""; OTHER_LDFLAGS = ( "-ObjC", @@ -915,11 +921,11 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "iPhone Sample/iPhone_Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_VERSION = ""; HEADER_SEARCH_PATHS = "${SDK_DIR}/usr/include/libxml2"; INFOPLIST_FILE = "iPhone Sample/Tests-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; - IPHONEOS_DEPLOYMENT_TARGET = 3.2.2; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; LIBRARY_SEARCH_PATHS = ""; OTHER_LDFLAGS = ( "-ObjC", @@ -943,10 +949,10 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "iPhone Sample/iPhone_Prefix.pch"; - GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_VERSION = ""; HEADER_SEARCH_PATHS = "${SDK_DIR}/usr/include/libxml2"; INFOPLIST_FILE = "iPhone Sample/iPadInfo.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 3.2; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; PRODUCT_NAME = "ASIHTTPRequest iPad"; TARGETED_DEVICE_FAMILY = 2; }; @@ -961,10 +967,10 @@ COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "iPhone Sample/iPhone_Prefix.pch"; - GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_VERSION = ""; HEADER_SEARCH_PATHS = "${SDK_DIR}/usr/include/libxml2"; INFOPLIST_FILE = "iPhone Sample/iPadInfo.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 3.2; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; PRODUCT_NAME = "ASIHTTPRequest iPad"; TARGETED_DEVICE_FAMILY = 2; }; @@ -978,6 +984,7 @@ GCC_C_LANGUAGE_STANDARD = c99; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; }; @@ -991,6 +998,7 @@ GCC_C_LANGUAGE_STANDARD = c99; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; SDKROOT = iphoneos; }; name = Release;