From db937d3b036a4570ac25615a3f2c0dd24900fda9 Mon Sep 17 00:00:00 2001 From: Ben Copsey Date: Thu, 17 Jun 2010 12:06:25 +0100 Subject: [PATCH] Starting point for new iPhone and iPad sample app --- Classes/ASIHTTPRequest.m | 2 +- iPhone Sample/AuthenticationViewController.h | 19 +- iPhone Sample/AuthenticationViewController.m | 176 ++++- iPhone Sample/DetailCell.h | 17 + iPhone Sample/DetailCell.m | 35 + iPhone Sample/InfoCell.h | 17 + iPhone Sample/InfoCell.m | 66 ++ iPhone Sample/QueueViewController.h | 19 +- iPhone Sample/QueueViewController.m | 191 ++++- iPhone Sample/Resources/Sample.xib | 349 +++++++++ iPhone Sample/Resources/iPadMainWindow.xib | 461 ++++++++++++ .../iPhoneMainWindow.xib} | 499 +++++-------- iPhone Sample/Resources/info.png | Bin 0 -> 5475 bytes iPhone Sample/RootViewController.h | 19 + iPhone Sample/RootViewController.m | 115 +++ iPhone Sample/SampleViewController.h | 22 + iPhone Sample/SampleViewController.m | 55 ++ iPhone Sample/SynchronousViewController.h | 12 +- iPhone Sample/SynchronousViewController.m | 172 ++++- iPhone Sample/ToggleCell.h | 18 + iPhone Sample/ToggleCell.m | 24 + iPhone Sample/UploadViewController.h | 15 +- iPhone Sample/UploadViewController.m | 143 +++- iPhone Sample/XIBs/Authentication.xib | 647 ----------------- iPhone Sample/XIBs/Queue.xib | 679 ------------------ iPhone Sample/XIBs/Synchronous.xib | 529 -------------- iPhone Sample/XIBs/UploadProgress.xib | 578 --------------- iPhone Sample/{Info.plist => iPadInfo.plist} | 8 +- iPhone Sample/iPadSampleAppDelegate.h | 19 + iPhone Sample/iPadSampleAppDelegate.m | 28 + iPhone Sample/iPhoneInfo.plist | 26 + iPhone Sample/iPhoneSampleAppDelegate.h | 3 +- iPhone Sample/iPhoneSampleAppDelegate.m | 15 +- iPhone Sample/main.m | 2 +- iPhone.xcodeproj/project.pbxproj | 269 ++++++- 35 files changed, 2349 insertions(+), 2900 deletions(-) create mode 100644 iPhone Sample/DetailCell.h create mode 100644 iPhone Sample/DetailCell.m create mode 100644 iPhone Sample/InfoCell.h create mode 100644 iPhone Sample/InfoCell.m create mode 100644 iPhone Sample/Resources/Sample.xib create mode 100644 iPhone Sample/Resources/iPadMainWindow.xib rename iPhone Sample/{XIBs/MainWindow.xib => Resources/iPhoneMainWindow.xib} (58%) create mode 100644 iPhone Sample/Resources/info.png create mode 100644 iPhone Sample/RootViewController.h create mode 100644 iPhone Sample/RootViewController.m create mode 100644 iPhone Sample/SampleViewController.h create mode 100644 iPhone Sample/SampleViewController.m create mode 100644 iPhone Sample/ToggleCell.h create mode 100644 iPhone Sample/ToggleCell.m delete mode 100644 iPhone Sample/XIBs/Authentication.xib delete mode 100644 iPhone Sample/XIBs/Queue.xib delete mode 100644 iPhone Sample/XIBs/Synchronous.xib delete mode 100644 iPhone Sample/XIBs/UploadProgress.xib rename iPhone Sample/{Info.plist => iPadInfo.plist} (87%) create mode 100644 iPhone Sample/iPadSampleAppDelegate.h create mode 100644 iPhone Sample/iPadSampleAppDelegate.m create mode 100644 iPhone Sample/iPhoneInfo.plist diff --git a/Classes/ASIHTTPRequest.m b/Classes/ASIHTTPRequest.m index 2364d2ff..08abd5e1 100644 --- a/Classes/ASIHTTPRequest.m +++ b/Classes/ASIHTTPRequest.m @@ -23,7 +23,7 @@ // Automatically set on build -NSString *ASIHTTPRequestVersion = @"v1.6.2-16 2010-06-15"; +NSString *ASIHTTPRequestVersion = @"v1.6.2-17 2010-06-17"; NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain"; diff --git a/iPhone Sample/AuthenticationViewController.h b/iPhone Sample/AuthenticationViewController.h index eb66ff21..8df9f422 100644 --- a/iPhone Sample/AuthenticationViewController.h +++ b/iPhone Sample/AuthenticationViewController.h @@ -1,23 +1,24 @@ // // AuthenticationViewController.h -// iPhone +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details // // Created by Ben Copsey on 01/08/2009. // Copyright 2009 All-Seeing Interactive. All rights reserved. // #import +#import "SampleViewController.h" @class ASIHTTPRequest; -@interface AuthenticationViewController : UIViewController { - IBOutlet UISwitch *useKeychain; - IBOutlet UISwitch *useBuiltInDialog; - IBOutlet UILabel *topSecretInfo; - ASIHTTPRequest *requestRequiringAuthentication; - ASIHTTPRequest *requestRequiringProxyAuthentication; +@interface AuthenticationViewController : SampleViewController { + + ASIHTTPRequest *request; + + UISwitch *useKeychain; + UISwitch *useBuiltInDialog; + UITextView *responseField; } - (IBAction)fetchTopSecretInformation:(id)sender; -@property (retain) ASIHTTPRequest *requestRequiringAuthentication; -@property (retain) ASIHTTPRequest *requestRequiringProxyAuthentication; +@property (retain, nonatomic) ASIHTTPRequest *request; @end diff --git a/iPhone Sample/AuthenticationViewController.m b/iPhone Sample/AuthenticationViewController.m index 9838d411..910de0ca 100644 --- a/iPhone Sample/AuthenticationViewController.m +++ b/iPhone Sample/AuthenticationViewController.m @@ -1,6 +1,6 @@ // // AuthenticationViewController.m -// iPhone +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details // // Created by Ben Copsey on 01/08/2009. // Copyright 2009 All-Seeing Interactive. All rights reserved. @@ -8,12 +8,15 @@ #import "AuthenticationViewController.h" #import "ASIHTTPRequest.h" +#import "InfoCell.h" +#import "DetailCell.h" +#import "ToggleCell.h" @implementation AuthenticationViewController - (IBAction)fetchTopSecretInformation:(id)sender { - ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/top_secret/"]]; + [self setRequest:[ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/top_secret/"]]]; [request setUseKeychainPersistence:[useKeychain isOn]]; [request setDelegate:self]; [request setShouldPresentAuthenticationDialog:[useBuiltInDialog isOn]]; @@ -23,25 +26,20 @@ - (IBAction)fetchTopSecretInformation:(id)sender } -- (IBAction)topSecretFetchFailed:(ASIHTTPRequest *)request +- (IBAction)topSecretFetchFailed:(ASIHTTPRequest *)theRequest { - [topSecretInfo setText:[[request error] localizedDescription]]; - [topSecretInfo setFont:[UIFont boldSystemFontOfSize:12]]; + [responseField setText:[[request error] localizedDescription]]; + [responseField setFont:[UIFont boldSystemFontOfSize:12]]; } -- (IBAction)topSecretFetchComplete:(ASIHTTPRequest *)request +- (IBAction)topSecretFetchComplete:(ASIHTTPRequest *)theRequest { - [topSecretInfo setText:[request responseString]]; - [topSecretInfo setFont:[UIFont boldSystemFontOfSize:12]]; + [responseField setText:[request responseString]]; + [responseField setFont:[UIFont boldSystemFontOfSize:12]]; } -- (void)authenticationNeededForRequest:(ASIHTTPRequest *)request +- (void)authenticationNeededForRequest:(ASIHTTPRequest *)theRequest { - // Why oh why is there no contextInfo for alertView like on Mac OS ?! - [self setRequestRequiringProxyAuthentication:nil]; - [self setRequestRequiringAuthentication:request]; - - UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:@"Please Login" message:[request authenticationRealm] delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK",nil] autorelease]; // These are undocumented, use at your own risk! // A better general approach would be to subclass UIAlertView, or just use ASIHTTPRequest's built-in dialog @@ -51,10 +49,8 @@ - (void)authenticationNeededForRequest:(ASIHTTPRequest *)request } -- (void)proxyAuthenticationNeededForRequest:(ASIHTTPRequest *)request +- (void)proxyAuthenticationNeededForRequest:(ASIHTTPRequest *)theRequest { - [self setRequestRequiringAuthentication:nil]; - [self setRequestRequiringProxyAuthentication:request]; UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:@"Please Login to proxy" message:[request authenticationRealm] delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK",nil] autorelease]; [alertView addTextFieldWithValue:@"" label:@"Username"]; [alertView addTextFieldWithValue:@"" label:@"Password"]; @@ -66,17 +62,17 @@ - (void)proxyAuthenticationNeededForRequest:(ASIHTTPRequest *)request - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex == 1) { - if ([self requestRequiringAuthentication]) { - [[self requestRequiringAuthentication] setUsername:[[alertView textFieldAtIndex:0] text]]; - [[self requestRequiringAuthentication] setPassword:[[alertView textFieldAtIndex:1] text]]; - [[self requestRequiringAuthentication] retryUsingSuppliedCredentials]; - } else if ([self requestRequiringProxyAuthentication]) { - [[self requestRequiringProxyAuthentication] setProxyUsername:[[alertView textFieldAtIndex:0] text]]; - [[self requestRequiringProxyAuthentication] setProxyPassword:[[alertView textFieldAtIndex:1] text]]; - [[self requestRequiringProxyAuthentication] retryUsingSuppliedCredentials]; + if ([[self request] authenticationNeeded] == ASIHTTPAuthenticationNeeded) { + [[self request] setUsername:[[alertView textFieldAtIndex:0] text]]; + [[self request] setPassword:[[alertView textFieldAtIndex:1] text]]; + [[self request] retryUsingSuppliedCredentials]; + } else if ([[self request] authenticationNeeded] == ASIProxyAuthenticationNeeded) { + [[self request] setProxyUsername:[[alertView textFieldAtIndex:0] text]]; + [[self request] setProxyPassword:[[alertView textFieldAtIndex:1] text]]; + [[self request] retryUsingSuppliedCredentials]; } } else { - [[self requestRequiringAuthentication] cancelAuthentication]; + [[self request] cancelAuthentication]; } } @@ -99,11 +95,131 @@ - (void)didReceiveMemoryWarning { - (void)dealloc { - [requestRequiringAuthentication release]; - [requestRequiringProxyAuthentication release]; + [request cancel]; + [request release]; [super dealloc]; } -@synthesize requestRequiringAuthentication; -@synthesize requestRequiringProxyAuthentication; +/* + Most of the code below here relates to the table view, and isn't that interesting + */ + +- (void)viewDidLoad +{ + [[[self navigationBar] topItem] setTitle:@"HTTP Authentication"]; +} + +static NSString *intro = @"Demonstrates fetching content from an area that requires HTTP authentication. You will be prompted for a username and password, enter 'topsecret' for both.\nIf 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.\nToggle 'Use built-in dialog' to switch between ASIHTTPRequest's built-in dialog, and one created by the delegate."; + +- (UIView *)tableView:(UITableView *)theTableView viewForHeaderInSection:(NSInteger)section +{ + if (section == 1) { + int tablePadding = 40; + int tableWidth = [tableView frame].size.width; + if (tableWidth > 480) { // iPad + tablePadding = 110; + } + + UIView *view = [[[UIView alloc] initWithFrame:CGRectMake(0,0,tableWidth-(tablePadding/2),30)] autorelease]; + UIButton *goButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; + [goButton setTitle:@"Go!" forState:UIControlStateNormal]; + [goButton sizeToFit]; + [goButton setFrame:CGRectMake([view frame].size.width-[goButton frame].size.width+10,7,[goButton frame].size.width,[goButton frame].size.height)]; + + [goButton addTarget:self action:@selector(fetchTopSecretInformation:) forControlEvents:UIControlEventTouchDown]; + [view addSubview:goButton]; + + return view; + } + return nil; +} + +- (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell; + if ([indexPath section] == 0) { + cell = [InfoCell cellWithDescription:intro]; + } else if ([indexPath section] == 1) { + cell = [tableView dequeueReusableCellWithIdentifier:@"ToggleCell"]; + if (!cell) { + cell = [ToggleCell cell]; + } + } else { + cell = [tableView dequeueReusableCellWithIdentifier:@"MyCell"]; + if (!cell) { + cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MyCell"] autorelease]; + } + } + [cell setSelectionStyle:UITableViewCellSelectionStyleNone]; + + int tablePadding = 40; + int tableWidth = [tableView frame].size.width; + if (tableWidth > 480) { // iPad + tablePadding = 110; + } + + switch ([indexPath section]) { + case 1: + switch ([indexPath row]) { + case 0: + [[cell textLabel] setText:@"Use Keychain"]; + useKeychain = [(ToggleCell *)cell toggle]; + break; + case 1: + [[cell textLabel] setText:@"Use Built-In Dialog"]; + useBuiltInDialog = [(ToggleCell *)cell toggle]; + break; + } + break; + case 2: + responseField = [[[UITextView alloc] initWithFrame:CGRectMake(5,5,tableWidth-tablePadding,150)] autorelease]; + [responseField setBackgroundColor:[UIColor clearColor]]; + [responseField setText:@"Secret information will appear here if authentication succeeds"]; + [[cell contentView] addSubview:responseField]; + break; + } + return cell; +} + +- (NSInteger)tableView:(UITableView *)theTableView numberOfRowsInSection:(NSInteger)section +{ + if (section == 1) { + return 2; + } else { + return 1; + } +} + +- (CGFloat)tableView:(UITableView *)theTableView heightForHeaderInSection:(NSInteger)section +{ + if (section == 1) { + return 50; + } + return 34; +} + +- (CGFloat)tableView:(UITableView *)theTableView heightForRowAtIndexPath:(NSIndexPath *)indexPath +{ + if ([indexPath section] == 0) { + return [InfoCell neededHeightForDescription:intro withTableWidth:[tableView frame].size.width]+20; + } else if ([indexPath section] == 2) { + return 160; + } else { + return 42; + } +} + +- (NSString *)tableView:(UITableView *)theTableView titleForHeaderInSection:(NSInteger)section +{ + + return nil; +} + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 3; +} + + +@synthesize request; @end diff --git a/iPhone Sample/DetailCell.h b/iPhone Sample/DetailCell.h new file mode 100644 index 00000000..30413a06 --- /dev/null +++ b/iPhone Sample/DetailCell.h @@ -0,0 +1,17 @@ +// +// DetailCell.h +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details +// +// Created by Ben Copsey on 16/06/2010. +// Copyright 2010 All-Seeing Interactive. All rights reserved. +// + +#import + + +@interface DetailCell : UITableViewCell { + +} ++ (id)cell; + +@end diff --git a/iPhone Sample/DetailCell.m b/iPhone Sample/DetailCell.m new file mode 100644 index 00000000..c1c1e8e7 --- /dev/null +++ b/iPhone Sample/DetailCell.m @@ -0,0 +1,35 @@ +// +// DetailCell.m +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details +// +// Created by Ben Copsey on 16/06/2010. +// Copyright 2010 All-Seeing Interactive. All rights reserved. +// + +#import "DetailCell.h" + + +@implementation DetailCell + ++ (id)cell +{ + DetailCell *cell = [[[DetailCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:@"HeaderCell"] autorelease]; + [[cell detailTextLabel] setTextAlignment:UITextAlignmentLeft]; + [[cell detailTextLabel] setFont:[UIFont systemFontOfSize:14]]; + return cell; +} + +- (void)layoutSubviews +{ + [super layoutSubviews]; + int tablePadding = 40; + int tableWidth = [[self superview] frame].size.width; + if (tableWidth > 480) { // iPad + tablePadding = 110; + } + [[self textLabel] setFrame:CGRectMake(5,5,120,20)]; + [[self detailTextLabel] setFrame:CGRectMake(135,5,[self frame].size.width-145-tablePadding,20)]; + +} + +@end diff --git a/iPhone Sample/InfoCell.h b/iPhone Sample/InfoCell.h new file mode 100644 index 00000000..94e2c487 --- /dev/null +++ b/iPhone Sample/InfoCell.h @@ -0,0 +1,17 @@ +// +// InfoCell.h +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details +// +// Created by Ben Copsey on 17/06/2010. +// Copyright 2010 All-Seeing Interactive. All rights reserved. +// + +#import + + +@interface InfoCell : UITableViewCell { + +} ++ (id)cellWithDescription:(NSString *)description; ++ (NSUInteger)neededHeightForDescription:(NSString *)description withTableWidth:(NSUInteger)tableWidth; +@end diff --git a/iPhone Sample/InfoCell.m b/iPhone Sample/InfoCell.m new file mode 100644 index 00000000..f264b6b7 --- /dev/null +++ b/iPhone Sample/InfoCell.m @@ -0,0 +1,66 @@ +// +// InfoCell.m +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details +// +// Created by Ben Copsey on 17/06/2010. +// Copyright 2010 All-Seeing Interactive. All rights reserved. +// + +#import "InfoCell.h" + + +@implementation InfoCell + ++ (id)cellWithDescription:(NSString *)description +{ + InfoCell *cell = [[[InfoCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"InfoCell"] autorelease]; + if ([[UIScreen mainScreen] bounds].size.width > 480) { // iPad + [[cell textLabel] setFont:[UIFont systemFontOfSize:14]]; + } else { + [[cell textLabel] setFont:[UIFont systemFontOfSize:13]]; + } + [[cell textLabel] setLineBreakMode:UILineBreakModeWordWrap]; + [[cell textLabel] setNumberOfLines:0]; + [[cell textLabel] setText:description]; + [[cell textLabel] sizeToFit]; + + if ([[UIScreen mainScreen] bounds].size.width > 480) { // iPad + UIImageView *imageView = [[[UIImageView alloc] initWithFrame:CGRectMake(10,10,48,48)] autorelease]; + [imageView setImage:[UIImage imageNamed:@"info.png"]]; + [[cell contentView] addSubview:imageView]; + } + return cell; +} + +- (void)layoutSubviews +{ + [super layoutSubviews]; + int tablePadding = 40; + int 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])]; + } else { + [[self textLabel] setFrame:CGRectMake(10,10,tableWidth-tablePadding,[[self class] neededHeightForDescription:[[self textLabel] text] withTableWidth:tableWidth])]; + } + +} + ++ (NSUInteger)neededHeightForDescription:(NSString *)description withTableWidth:(NSUInteger)tableWidth +{ + int tablePadding = 40; + int offset = 0; + int textSize = 13; + if (tableWidth > 480) { // iPad + tablePadding = 110; + offset = 70; + textSize = 14; + } + CGSize labelSize = [description sizeWithFont:[UIFont systemFontOfSize:textSize] constrainedToSize:CGSizeMake(tableWidth-tablePadding-offset,1000) lineBreakMode:UILineBreakModeWordWrap]; + if (labelSize.height < 48) { + return 58; + } + return labelSize.height; +} + +@end diff --git a/iPhone Sample/QueueViewController.h b/iPhone Sample/QueueViewController.h index 4596b4be..76ecaafa 100644 --- a/iPhone Sample/QueueViewController.h +++ b/iPhone Sample/QueueViewController.h @@ -1,23 +1,28 @@ // // QueueViewController.h -// asi-http-request +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details // // Created by Ben Copsey on 07/11/2008. // Copyright 2008 All-Seeing Interactive. All rights reserved. // #import +#import "SampleViewController.h" @class ASINetworkQueue; -@interface QueueViewController : UIViewController { +@interface QueueViewController : SampleViewController { ASINetworkQueue *networkQueue; - IBOutlet UIImageView *imageView1; - IBOutlet UIImageView *imageView2; - IBOutlet UIImageView *imageView3; - IBOutlet UIProgressView *progressIndicator; - IBOutlet UISwitch *accurateProgress; + UIImageView *imageView1; + UIImageView *imageView2; + UIImageView *imageView3; + UIProgressView *progressIndicator; + UISwitch *accurateProgress; + UIProgressView *imageProgressIndicator1; + UIProgressView *imageProgressIndicator2; + UIProgressView *imageProgressIndicator3; + BOOL failed; } diff --git a/iPhone Sample/QueueViewController.m b/iPhone Sample/QueueViewController.m index 3c49d718..7b16bded 100644 --- a/iPhone Sample/QueueViewController.m +++ b/iPhone Sample/QueueViewController.m @@ -1,6 +1,6 @@ // // QueueViewController.m -// asi-http-request +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details // // Created by Ben Copsey on 07/11/2008. // Copyright 2008 All-Seeing Interactive. All rights reserved. @@ -9,38 +9,43 @@ #import "QueueViewController.h" #import "ASIHTTPRequest.h" #import "ASINetworkQueue.h" +#import "InfoCell.h" +#import "ToggleCell.h" @implementation QueueViewController -- (void)awakeFromNib -{ - networkQueue = [[ASINetworkQueue alloc] init]; -} - - (IBAction)fetchThreeImages:(id)sender { [imageView1 setImage:nil]; [imageView2 setImage:nil]; [imageView3 setImage:nil]; - [networkQueue cancelAllOperations]; + if (!networkQueue) { + networkQueue = [[ASINetworkQueue alloc] init]; + } + failed = NO; + [networkQueue reset]; [networkQueue setDownloadProgressDelegate:progressIndicator]; [networkQueue setRequestDidFinishSelector:@selector(imageFetchComplete:)]; + [networkQueue setRequestDidFailSelector:@selector(imageFetchFailed:)]; [networkQueue setShowAccurateProgress:[accurateProgress isOn]]; [networkQueue setDelegate:self]; ASIHTTPRequest *request; request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/ASIHTTPRequest/tests/images/small-image.jpg"]]; [request setDownloadDestinationPath:[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:@"1.png"]]; + [request setDownloadProgressDelegate:imageProgressIndicator1]; [networkQueue addOperation:request]; request = [[[ASIHTTPRequest alloc] initWithURL:[NSURL URLWithString:@"http://allseeing-i.com/ASIHTTPRequest/tests/images/medium-image.jpg"]] autorelease]; [request setDownloadDestinationPath:[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:@"2.png"]]; + [request setDownloadProgressDelegate:imageProgressIndicator2]; [networkQueue addOperation:request]; request = [[[ASIHTTPRequest alloc] initWithURL:[NSURL URLWithString:@"http://allseeing-i.com/ASIHTTPRequest/tests/images/large-image.jpg"]] autorelease]; [request setDownloadDestinationPath:[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:@"3.png"]]; + [request setDownloadProgressDelegate:imageProgressIndicator3]; [networkQueue addOperation:request]; [networkQueue go]; @@ -63,10 +68,182 @@ - (void)imageFetchComplete:(ASIHTTPRequest *)request } } +- (void)imageFetchFailed:(ASIHTTPRequest *)request +{ + if (!failed) { + if ([[request error] domain] != NetworkRequestErrorDomain || [[request error] code] != ASIRequestCancelledErrorType) { + UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:@"Download failed" message:@"Failed to download images" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] autorelease]; + [alertView show]; + } + failed = YES; + } +} + - (void)dealloc { + [networkQueue reset]; [networkQueue release]; [super dealloc]; } +/* + Most of the code below here relates to the table view, and isn't that interesting + */ + +- (void)viewDidLoad +{ + [[[self navigationBar] topItem] setTitle:@"Using a Queue"]; +} + +static NSString *intro = @"Demonstrates a fetching 3 items at once, using an ASINetworkQueue to track progress.\r\nEach request has its own downloadProgressDelegate, and the queue has an additional downloadProgressDelegate to track overall progress."; + +- (UIView *)tableView:(UITableView *)theTableView viewForHeaderInSection:(NSInteger)section +{ + if (section == 1) { + int tablePadding = 40; + int tableWidth = [tableView frame].size.width; + if (tableWidth > 480) { // iPad + tablePadding = 110; + } + + UIView *view = [[[UIView alloc] initWithFrame:CGRectMake(0,0,tableWidth-(tablePadding/2),30)] autorelease]; + UIButton *goButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; + [goButton setTitle:@"Go!" forState:UIControlStateNormal]; + [goButton sizeToFit]; + [goButton setFrame:CGRectMake([view frame].size.width-[goButton frame].size.width+10,7,[goButton frame].size.width,[goButton frame].size.height)]; + + [goButton addTarget:self action:@selector(fetchThreeImages:) forControlEvents:UIControlEventTouchUpInside]; + [view addSubview:goButton]; + + progressIndicator = [[[UIProgressView alloc] initWithFrame:CGRectMake((tablePadding/2)-10,20,200,10)] autorelease]; + [view addSubview:progressIndicator]; + + return view; + } + return nil; +} + +- (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell; + if ([indexPath section] == 0) { + cell = [InfoCell cellWithDescription:intro]; + } else if ([indexPath section] == 1) { + cell = [tableView dequeueReusableCellWithIdentifier:@"ToggleCell"]; + if (!cell) { + cell = [ToggleCell cell]; + } + } else { + cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MyCell"] autorelease]; + } + [cell setSelectionStyle:UITableViewCellSelectionStyleNone]; + + int tablePadding = 40; + int tableWidth = [tableView frame].size.width; + if (tableWidth > 480) { // iPad + tablePadding = 110; + } + + if ([indexPath section] == 1) { + [[cell textLabel] setText:@"Show Accurate Progress"]; + accurateProgress = [(ToggleCell *)cell toggle]; + } else if ([indexPath section] == 2) { + + NSUInteger imageWidth = (tableWidth-tablePadding-20)/3; + NSUInteger imageHeight = imageWidth*0.66; + + imageView1 = [[[UIImageView alloc] initWithFrame:CGRectMake(tablePadding/2,10,imageWidth,imageHeight)] autorelease]; + [imageView1 setBackgroundColor:[UIColor grayColor]]; + [cell addSubview:imageView1]; + + imageProgressIndicator1 = [[[UIProgressView alloc] initWithFrame:CGRectMake(tablePadding/2,15+imageHeight,imageWidth,20)] autorelease]; + [cell addSubview:imageProgressIndicator1]; + + UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(tablePadding/2,25+imageHeight,imageWidth,20)] autorelease]; + if (tableWidth > 480) { + [label setText:@"This image is 15KB in size"]; + } else { + [label setText:@"Img size: 15KB"]; + } + [label setTextAlignment:UITextAlignmentCenter]; + [label setFont:[UIFont systemFontOfSize:11]]; + [label setBackgroundColor:[UIColor clearColor]]; + [cell addSubview:label]; + + imageView2 = [[[UIImageView alloc] initWithFrame:CGRectMake((tablePadding/2)+imageWidth+10,10,imageWidth,imageHeight)] autorelease]; + [imageView2 setBackgroundColor:[UIColor grayColor]]; + [cell addSubview:imageView2]; + + imageProgressIndicator2 = [[[UIProgressView alloc] initWithFrame:CGRectMake((tablePadding/2)+imageWidth+10,15+imageHeight,imageWidth,20)] autorelease]; + [cell addSubview:imageProgressIndicator2]; + + label = [[[UILabel alloc] initWithFrame:CGRectMake(tablePadding/2+imageWidth+10,25+imageHeight,imageWidth,20)] autorelease]; + if (tableWidth > 480) { + [label setText:@"This image is 176KB in size"]; + } else { + [label setText:@"Img size: 176KB"]; + } + [label setTextAlignment:UITextAlignmentCenter]; + [label setFont:[UIFont systemFontOfSize:11]]; + [label setBackgroundColor:[UIColor clearColor]]; + [cell addSubview:label]; + + imageView3 = [[[UIImageView alloc] initWithFrame:CGRectMake((tablePadding/2)+(imageWidth*2)+20,10,imageWidth,imageHeight)] autorelease]; + [imageView3 setBackgroundColor:[UIColor grayColor]]; + [cell addSubview:imageView3]; + + imageProgressIndicator3 = [[[UIProgressView alloc] initWithFrame:CGRectMake((tablePadding/2)+(imageWidth*2)+20,15+imageHeight,imageWidth,20)] autorelease]; + [cell addSubview:imageProgressIndicator3]; + + label = [[[UILabel alloc] initWithFrame:CGRectMake(tablePadding/2+(imageWidth*2)+20,25+imageHeight,imageWidth,20)] autorelease]; + if (tableWidth > 480) { + [label setText:@"This image is 1.4MB in size"]; + } else { + [label setText:@"Img size: 1.4MB"]; + } + [label setTextAlignment:UITextAlignmentCenter]; + [label setFont:[UIFont systemFontOfSize:11]]; + [label setBackgroundColor:[UIColor clearColor]]; + [cell addSubview:label]; + + } + return cell; +} + +- (NSInteger)tableView:(UITableView *)theTableView numberOfRowsInSection:(NSInteger)section +{ + return 1; +} + +- (CGFloat)tableView:(UITableView *)theTableView heightForHeaderInSection:(NSInteger)section +{ + if (section == 1) { + return 50; + } + return 34; +} + +- (CGFloat)tableView:(UITableView *)theTableView heightForRowAtIndexPath:(NSIndexPath *)indexPath +{ + 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; + if (tableWidth > 480) { // iPad + tablePadding = 110; + } + NSUInteger imageWidth = (tableWidth-tablePadding-20)/3; + NSUInteger imageHeight = imageWidth*0.66; + return imageHeight+50; + } else { + return 42; + } +} + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 3; +} + @end diff --git a/iPhone Sample/Resources/Sample.xib b/iPhone Sample/Resources/Sample.xib new file mode 100644 index 00000000..0e923b76 --- /dev/null +++ b/iPhone Sample/Resources/Sample.xib @@ -0,0 +1,349 @@ + + + + 800 + 10F569 + 788 + 1038.29 + 461.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 117 + + + YES + + + + YES + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + YES + + YES + + + YES + + + + YES + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 292 + + YES + + + 290 + {320, 44} + + IBCocoaTouchFramework + + YES + + + Title + IBCocoaTouchFramework + + + + + + 274 + {{0, 44}, {320, 387}} + + + 10 + + 549453824 + {84, 1} + + YES + + YES + + + + TU0AKgAAAVjFzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ +y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ +xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ +xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ +xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ +xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P8ADQEAAAMAAAABAFQAAAEB +AAMAAAABAAEAAAECAAMAAAAEAAAB+gEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES +AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABAAEAAAEXAAQAAAABAAABUAEcAAMAAAABAAEAAAFS +AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA + + + + + + 3 + MCAwAA + + + groupTableViewBackgroundColor + + YES + IBCocoaTouchFramework + YES + 1 + 2 + 0 + YES + 44 + 10 + 10 + + + {320, 431} + + + 3 + MQA + + 2 + + + IBCocoaTouchFramework + + + + + YES + + + dataSource + + + + 23 + + + + delegate + + + + 24 + + + + view + + + + 25 + + + + tableView + + + + 27 + + + + navigationBar + + + + 30 + + + + + YES + + 0 + + + + + + -1 + + + File's Owner + + + -2 + + + + + 18 + + + YES + + + + + + + 28 + + + YES + + + + + + 29 + + + + + 16 + + + + + + + YES + + YES + -1.CustomClassName + -2.CustomClassName + 16.IBEditorWindowLastContentRect + 16.IBPluginDependency + 18.IBEditorWindowLastContentRect + 18.IBPluginDependency + 28.IBPluginDependency + 29.IBPluginDependency + + + YES + SynchronousViewController + UIResponder + {{329, 685}, {320, 460}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + {{355, 500}, {320, 431}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 30 + + + + YES + + NSObject + + IBProjectSource + External/GHUnit/Project-IPhone/build/Debug-iphonesimulator/GHUNSObject+Swizzle.h + + + + SampleViewController + UIViewController + + YES + + YES + navigationBar + tableView + + + YES + UINavigationBar + UITableView + + + + YES + + YES + navigationBar + tableView + + + YES + + navigationBar + UINavigationBar + + + tableView + UITableView + + + + + IBProjectSource + SampleViewController.h + + + + SynchronousViewController + SampleViewController + + simpleURLFetch: + NSURL + + + simpleURLFetch: + + simpleURLFetch: + NSURL + + + + IBProjectSource + iPhone Sample/SynchronousViewController.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 + + + YES + ../../iPhone.xcodeproj + 3 + 117 + + diff --git a/iPhone Sample/Resources/iPadMainWindow.xib b/iPhone Sample/Resources/iPadMainWindow.xib new file mode 100644 index 00000000..493422c6 --- /dev/null +++ b/iPhone Sample/Resources/iPadMainWindow.xib @@ -0,0 +1,461 @@ + + + + 800 + 10F569 + 788 + 1038.29 + 461.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 117 + + + YES + + + YES + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + YES + + YES + + + YES + + + + YES + + IBFilesOwner + IBIPadFramework + + + IBFirstResponder + IBIPadFramework + + + IBIPadFramework + + + + 1316 + + {768, 1024} + + 1 + MSAxIDEAA + + NO + NO + + 2 + + IBIPadFramework + YES + + + + + 2 + + + 3 + + IBIPadFramework + YES + + + + 2 + + + 1 + + IBIPadFramework + NO + + + 256 + {0, 0} + YES + YES + IBIPadFramework + + + YES + + + + ASIHTTPRequest Examples + IBIPadFramework + + + + 2 + + + 1 + + IBIPadFramework + NO + NO + + + + + + Synchronous + + 2 + + + 1 + + IBIPadFramework + NO + + + + + + YES + + + delegate + + + + 5 + + + + window + + + + 96 + + + + delegate + + + + 99 + + + + splitViewController + + + + 100 + + + + splitViewController + + + + 102 + + + + + YES + + 0 + + + + + + 2 + + + YES + + + + + -1 + + + File's Owner + + + 4 + + + App Delegate + + + -2 + + + + + 87 + + + YES + + + + + + + 88 + + + YES + + + + + + + 90 + + + YES + + + + + + 91 + + + + + 92 + + + + + 60 + + + YES + + + + + + + YES + + YES + -1.CustomClassName + -2.CustomClassName + 2.IBAttributePlaceholdersKey + 2.IBEditorWindowLastContentRect + 2.IBPluginDependency + 2.UIWindow.visibleAtLaunch + 4.CustomClassName + 4.IBPluginDependency + 60.CustomClassName + 60.IBPluginDependency + 87.IBEditorWindowLastContentRect + 87.IBPluginDependency + 88.IBPluginDependency + 90.CustomClassName + 90.IBPluginDependency + 91.IBPluginDependency + 92.IBPluginDependency + + + YES + UIApplication + UIResponder + + YES + + + YES + + + {{374, 13}, {768, 1024}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + iPadSampleAppDelegate + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + SynchronousViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + {{329, 308}, {1024, 768}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + RootViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 102 + + + + YES + + NSObject + + IBProjectSource + External/GHUnit/Project-IPhone/build/Debug-iphonesimulator/GHUNSObject+Swizzle.h + + + + RootViewController + UITableViewController + + splitViewController + UISplitViewController + + + splitViewController + + splitViewController + UISplitViewController + + + + IBProjectSource + RootViewController.h + + + + SampleViewController + UIViewController + + YES + + YES + navigationBar + tableView + + + YES + UINavigationBar + UITableView + + + + YES + + YES + navigationBar + tableView + + + YES + + navigationBar + UINavigationBar + + + tableView + UITableView + + + + + IBProjectSource + SampleViewController.h + + + + SynchronousViewController + SampleViewController + + simpleURLFetch: + id + + + simpleURLFetch: + + simpleURLFetch: + id + + + + IBProjectSource + iPhone Sample/SynchronousViewController.h + + + + iPadSampleAppDelegate + NSObject + + YES + + YES + splitViewController + window + + + YES + UISplitViewController + UIWindow + + + + YES + + YES + splitViewController + window + + + YES + + splitViewController + UISplitViewController + + + window + UIWindow + + + + + IBProjectSource + iPadSampleAppDelegate.h + + + + + 0 + IBIPadFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 + + + YES + ../../iPhone.xcodeproj + 3 + 117 + + diff --git a/iPhone Sample/XIBs/MainWindow.xib b/iPhone Sample/Resources/iPhoneMainWindow.xib similarity index 58% rename from iPhone Sample/XIBs/MainWindow.xib rename to iPhone Sample/Resources/iPhoneMainWindow.xib index b3fd224a..9103a049 100644 --- a/iPhone Sample/XIBs/MainWindow.xib +++ b/iPhone Sample/Resources/iPhoneMainWindow.xib @@ -2,18 +2,18 @@ 528 - 10C540 - 740 - 1038.25 - 458.00 + 10F569 + 788 + 1038.29 + 461.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 62 + 117 YES - + YES @@ -32,11 +32,15 @@ YES IBFilesOwner + IBCocoaTouchFramework IBFirstResponder + IBCocoaTouchFramework + + + IBCocoaTouchFramework - 1316 @@ -49,6 +53,7 @@ NO NO + IBCocoaTouchFramework YES @@ -65,6 +70,7 @@ NO YES NO + IBCocoaTouchFramework Helvetica-Bold @@ -90,48 +96,78 @@ NO NO + IBCocoaTouchFramework YES - - - Synchronous + + 1 + + IBCocoaTouchFramework + NO + + Authentication + + Authentication + IBCocoaTouchFramework + - Synchronous + Sample + + 1 + + IBCocoaTouchFramework + NO YES - + + + Synchronous + IBCocoaTouchFramework + + + + Sample + + 1 + + IBCocoaTouchFramework + NO + Queue + IBCocoaTouchFramework - Queue + Sample + + 1 + + IBCocoaTouchFramework + NO Upload + IBCocoaTouchFramework - UploadProgress - - - Authentication - - Authentication - + Sample + + 1 - - - Authentication + IBCocoaTouchFramework + NO + @@ -142,6 +178,7 @@ MCAwAA NO + IBCocoaTouchFramework @@ -331,7 +368,7 @@ YES UIApplication UIResponder - {{673, 425}, {320, 480}} + {{474, 471}, {320, 480}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin SynchronousViewController @@ -351,7 +388,7 @@ YES - {{890, 43}, {320, 480}} + {{1019, 29}, {320, 480}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin iPhoneSampleAppDelegate com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -380,24 +417,16 @@ YES AuthenticationViewController - UIViewController + SampleViewController fetchTopSecretInformation: id - - YES - - YES - topSecretInfo - useBuiltInDialog - useKeychain - - - YES - UILabel - UISwitch - UISwitch + + fetchTopSecretInformation: + + fetchTopSecretInformation: + id @@ -409,50 +438,81 @@ NSObject IBProjectSource - Frameworks/libGHUnitIPhone3_0-0/GHUNSObject+Swizzle.h + External/GHUnit/Project-IPhone/build/Debug-iphonesimulator/GHUNSObject+Swizzle.h QueueViewController - UIViewController + SampleViewController fetchThreeImages: id + + fetchThreeImages: + + fetchThreeImages: + id + + + + IBProjectSource + iPhone Sample/QueueViewController.h + + + + SampleViewController + UIViewController YES YES - accurateProgress - imageView1 - imageView2 - imageView3 - progressIndicator + navigationBar + tableView YES - UISwitch - UIImageView - UIImageView - UIImageView - UIProgressView + UINavigationBar + UITableView + + + + YES + + YES + navigationBar + tableView + + + YES + + navigationBar + UINavigationBar + + + tableView + UITableView + IBProjectSource - iPhone Sample/QueueViewController.h + SampleViewController.h SynchronousViewController - UIViewController + SampleViewController simpleURLFetch: id - - htmlSource - UITextView + + simpleURLFetch: + + simpleURLFetch: + id + IBProjectSource @@ -461,7 +521,7 @@ UploadViewController - UIViewController + SampleViewController YES @@ -475,10 +535,36 @@ id + + YES + + YES + performLargeUpload: + toggleThrottling: + + + YES + + performLargeUpload: + id + + + toggleThrottling: + id + + + progressIndicator UIProgressView + + progressIndicator + + progressIndicator + UIProgressView + + IBProjectSource iPhone Sample/UploadViewController.h @@ -502,291 +588,46 @@ UIWindow + + YES + + YES + statusMessage + tabBarController + window + + + YES + + statusMessage + UILabel + + + tabBarController + UITabBarController + + + window + UIWindow + + + IBProjectSource iPhone Sample/iPhoneSampleAppDelegate.h - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSNetServices.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPort.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSStream.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSXMLParser.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - UIApplication - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIApplication.h - - - - UIBarItem - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIBarItem.h - - - - UIControl - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIControl.h - - - - UIImageView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIImageView.h - - - - UILabel - UIView - - IBFrameworkSource - UIKit.framework/Headers/UILabel.h - - - - UIProgressView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIProgressView.h - - - - UIResponder - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIScrollView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIScrollView.h - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISwitch - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UISwitch.h - - - - UITabBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITabBar.h - - - - UITabBarController - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UITabBarItem - UIBarItem - - IBFrameworkSource - UIKit.framework/Headers/UITabBarItem.h - - - - UITextView - UIScrollView - - IBFrameworkSource - UIKit.framework/Headers/UITextView.h - - - - UIToolbar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIToolbar.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - UIWindow - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIWindow.h - - - 0 + IBCocoaTouchFramework com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 @@ -795,6 +636,6 @@ YES ../../iPhone.xcodeproj 3 - 3.1 + 117 diff --git a/iPhone Sample/Resources/info.png b/iPhone Sample/Resources/info.png new file mode 100644 index 0000000000000000000000000000000000000000..062e5a32f7efe73b69985bfc6f2765790a44b51a GIT binary patch literal 5475 zcmV-p6`bmcP)WMfZ<%}l_g>YjN`+Js=y)hlPsnl(E&H@Dp7a=P%6X_QB$o}S*G?w;;*XV0GfYS+$P)z#Iz z57yS!Hp#LKf7J(S*Rg*6hMV4h|ATFvo!!mKD2J@kXa@?Uedo?y|8>tj_kJ%wKR@HI zj`8g5?DU`g?4i4BYEJAM#-uzkia+Y>>%VyNi6{J;Hn9X`^!8v-RQmdZN?V6dIoB|#oT(pFPM#fL zbf(Uu)Z@9M zfPPO1EG86;!^D`SR~z3=LZS1BGnNz<6&LQ^yQeyc$0f4>oS@^Sm;UY92OoUketMZK zE5kHEOt|}kaHf6;npy+k4=8MOo{wrcd4p5*|Cvzeoi-~6MUyNrvpfx)xi+}iJa+7O z?+3%~*GTem*{%ujyu;|FE!rMlATFbN!LO=24V{Fnz?J40yV_#86M zbFn<>57Feq=n7#`28oTQPCRmt67Ny~_zH9*5t`8=!eI%rv&>*I3lUeM$C*6v=8B3L zGxH}E6u$rdd%N&@XuJZTF@?>WH$VOu9%Q;q;s%o^<}t9rzQcWR`kbHnH}gj>mS-bR zqNw_DzRLn71$MC81auDxfboT@y3*$tp!yMxh%*F7JxmSH- zj>C~=-?eM!Zj#Md1;E&>s;av6`RAYiEiVXyD9KDyIDPhMLZ57H_rmVa-O$l3s;15* zW=Vcwifm|SFs@+l6OTxdf-4}*I^WN~DqF*F6UqkmAw_Xkh_9OPtK zRaepGM!^~D3|O>i(Snu>Ef;sAVZ@#a{-0m zNa4VlqY6PkNC;@5-2C|q7kvEjM|-=vx?7VK0LSxu>T}P%@a)Q!%a@SJ8tu?*=Arq5 zs(G)UB7btBEgY7iv^WJSuS`#v%FHMnKQiCk>SwN%WN>CK(b^HfRLQGCkPJdVp=V^I zIm*h)OW%6y%?}Y=1%{>2L<3i?S@Yf7@3{RoNmeDPE5L-zclG#D^SvC?nzpb|AH!h1b~;b>AYn6z#Y{T>lD zIEFDbqPYwqcG!E+4TD1=7DpnkC#j11`7bs->~!W{5if*z0dQ;AuDx}^{CSlWu#A!v zP>6hr(03C=eRvGgg+V<&o!0N25zZZ%Lw zWx%pi#f)iX-@oVH4e|X5qX2lD%~o*V4<5LS1|Z4lBT&$5Y4yR0GlOcRN0rHABpTB* zD8a{jx)3R z4Z`O~+$@j@0w3cRVV_KJo(j^IyT@9c|Yyun{TU5H3xlnre&MuLq&DBsG$DN$4CWz{-`^Eqe9Uf2ZbZw~6t|bGdV` zy86nPI-Ag2NP(sc{z$Dpp+li`B*Aq{oUn9$E~^Vj7`ZkRo^wHFh8aHiq%#_LC)}?D zXleH|L2!H&caRdMO`kE%Vlg{Ip>Qv`0H2$in>VSTpoBD_K(xWo?+HSCm!AzL$?}9K zh|CjIoi`^7k(G4wo5N-xIpSY$|W z;_svA??dQWZKHg%1SkS2SR36R=(A0<dJxla)&n2k4!oL{=y(`g>$neP(867qB=_0!UBGa9PZ1HD)}h#id8) ziLSlTixuD^E|wrfXxKhh022`f36(&Rv1_CkPs`$rPBZm^cGhYLWxPOhRiSGo9>+F0W*&YglF3*cH^2b}6|CX?A35da<*PJ6&u zt%bCnounw^iuwxErV2y-AsHgQ1tszQBmjR<(z?bRi%_h?#*Z&8NDO0yV_iyjah_uk zK*a$H$t6|*z~H6K21(Wh^ezuGV@c~J7!alYJ)sLIsueJ>C8<&p4eJa9V zC8`aBG7`D~>l}>~bT!K&0TW^+h|7(Fn8*sLL&Tc7O0=^~{D>lnR26{I=XSd(Sj5{` zW`-q#;o~DVXXv|8s?@c{afyQ#^%vMZvfjFm<4;y&hE5|38)K6$2xLys;)9Z)-$j@r zHANV9fu8kxy*_%31R(eJ_VoG#ey~|nBC{hYWu{wL_>9*GXXv+4$5>H@YkatgYs_i? z4Z9AifTU#7t|~_mQN?DAlw=K%p!tuU4cVF27^@=-2>30T-16Wf+N|b5sb%u?X8t za@p0zm`KZ8fPQz6*xc0APPY+TVoy&`cXLx?J6?-)X{jMf(sSilAcz&BY$$1oaXKey zkTZFBI!Z@JhB3okngdm^G$-S=5T@O%bQ3tU?Q987=ZmsQQ&U4%eSO^p(hCy+Qt$EO zM;Zh^)?}?#6O@%WAQTkU7i#r>1e@brt3k#B=}$)|nr3 zfkK~}uO=jAoW+l#&W|cd7MEDDCBdAEY`n%9um{Hi;GR97euZE9hsa>22xjZB$!;3j*_&&`IZnvW@G`ZYdl79sJakb6bUL9OM^)uZ?=LLlGyP1 zxn?MzlF7>LNCy~!Z+m-3_`v>sN3~59BCk!y?{@c||Mb(HCrsw3#3&P(5J)V&#)Wl3 z5C_vtOj7HEv5+JgOkN&^#xXuiv$DG6?(+rV+N+(AVmC*3qab0y3kUY^t!-**JWEQ~ zgCOf5A@%(6kMHdFdBZGH>WU(3xN5c&it{Z9n8XQnZWTqj=*lk}TbkJT)NIMg5Mbfl zd=?iXO)gAh6fC!Ie`_Cp?a%}eX^K)D7(B55vjYbY?z>>K36aoD7@mS*)#_pp!=XrD zZ>(fQf)}HSG(jX*!3N=`>k1(w&B`!}KCl(@dCl?TJ-c>(v=@2xkcS%uK;GjGg+gC% z`;V7Dp%h3G)1^ntR`agPN3+TT&rl%g#mo4GOnDUUSwtVl*g6djh2R@AQeoMmLhuE| zXsE%UML6b-H@5Bd`~9^P^tIR*vouC-;Qru)_dedgZ*RNZW{zoDQS`iHO*yzSIq>_{ zv`E%57J`eJf21Uq$4oRAGW|4%1b5yx9Rnh-f+Z`Q^0`yWQ5GmKD*^Z&!Fc7@u=~daCMkcL(lHrfBNY4*SFQAI7|^(NiU*( ze{<(df_v6YMLg|et3{FAJxYM00lIqwQJ5RI>x095-P!9;KIrKn24O-`9Sh}zn zhJ4|eJqEP3ZpV)8=iYti?f39)g#W$9L@W%eNmSpEj~)HOw_??eiwX(~tYJegCCFJ( zo&$EP42O^7c$}GaZAQ})+c=4?GjDbdq^FtH?vP>E$)Hz+xBs^p{aD>^l+1Y4#;2n0 z_U{zK+Nv4g_e(K#hRtS$#)ihg1NZ;!zxMa{QS@&&n*T^!WQbeI=kxl{)z_MN46`a+keNz*209UWVOeV8wKSJ_lM`*Q@L-CiO^>r@WP$@BDm6AN7LMWe z|9-y_j-Bcow!>riW-E1LQ4pUA1^sZ>_ex;eXd;Ycf8 zym(2Tq(RQ;`k@S|4l68~UkD|WtkBZd2kl)H?5JDA$2GonA@IPnMh(XVLas2ppAzl# zP`AqK^+TbHhkMpeg}ZN?32A9|mX3`khKd45iUt1jciZY8-}KOnqA1Zuh?e-km#hF3 zEnN^k@K^8Nd4cDIf~Ct=7H}NqSy3|VAy84+6{Xp*d_e&eI0fkIAA)YTpRM~*MMj+% zbt5HrQ8xilH$zig@CCvMjYCj6$pq_eDuExYp9!;O$pUTI3?_ha2GO+uno6xv%;dH)Z8diUQy@$_;>Y8nqYHbzo?5qO)rd8ZV$AI=#?45JJo@vGc?@Rc$1+tPBfGaybypq(ebo z8s=~dt4Q^Z)bQU42#}g;hWh&Rfv2AM#m66h@a}dzeM-}O|7gsQ^#>E=(6rlt78R%F z<>fDZ?C+ks<&O3DmRl`mWG2KknD9Z4V-cPx(s))>2&-sTqi$_eOL5Y&sC9Qn`0WA; z42vBU{JY!VY}&HriFccu8msZrIV9Q=JD3dfM6F7O{i^Z7jT`p%*j9X^`xHZjx7jRASVz7*?0IhMKkh}X|DUGyW~5FH&B|k8 zXgr5Siwk58B?y#ef2Zn}T;EgTJ}L-pIdHhJU4Lq)K^`|c*Bt|51sAoY_Hdt?$l77Tg&g^ z3GF3d=K{3LHl%feFRkISicHX23 z%orne_#M2Px630B3pcEH1L4>rw#Y@e!@%VoM Z1^~mt21w&Un(6=m002ovPDHLkV1juNaz6k7 literal 0 HcmV?d00001 diff --git a/iPhone Sample/RootViewController.h b/iPhone Sample/RootViewController.h new file mode 100644 index 00000000..6d2cacdf --- /dev/null +++ b/iPhone Sample/RootViewController.h @@ -0,0 +1,19 @@ +// +// RootViewController.h +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details +// +// Created by Ben Copsey on 16/06/2010. +// Copyright 2010 All-Seeing Interactive. All rights reserved. +// + +#import + +@interface RootViewController : UITableViewController { + UISplitViewController *splitViewController; + UIPopoverController *popoverController; + UIBarButtonItem *rootPopoverButtonItem; +} +@property (nonatomic, assign) IBOutlet UISplitViewController *splitViewController; +@property (nonatomic, retain) UIPopoverController *popoverController; +@property (nonatomic, retain) UIBarButtonItem *rootPopoverButtonItem; +@end diff --git a/iPhone Sample/RootViewController.m b/iPhone Sample/RootViewController.m new file mode 100644 index 00000000..dd5cc9ae --- /dev/null +++ b/iPhone Sample/RootViewController.m @@ -0,0 +1,115 @@ +// +// RootViewController.m +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details +// +// Created by Ben Copsey on 16/06/2010. +// Copyright 2010 All-Seeing Interactive. All rights reserved. +// + +#import "RootViewController.h" +#import "SynchronousViewController.h" +#import "QueueViewController.h" +#import "AuthenticationViewController.h" +#import "UploadViewController.h" + +@implementation RootViewController + + +- (void)viewDidLoad +{ + [super viewDidLoad]; + self.contentSizeForViewInPopover = CGSizeMake(310.0, self.tableView.rowHeight*4.0); +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + return YES; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyCell"]; + if (!cell) { + cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MyCell"] autorelease]; + } + switch ([indexPath row]) { + case 0: + [[cell textLabel] setText:@"Synchronous"]; + break; + case 1: + [[cell textLabel] setText:@"Queue"]; + break; + case 2: + [[cell textLabel] setText:@"Authentication"]; + break; + case 3: + [[cell textLabel] setText:@"Upload"]; + break; + } + return cell; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return 4; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + UIViewController *viewController = nil; + switch ([indexPath row]) { + case 0: + viewController = [[[SynchronousViewController alloc] initWithNibName:@"Sample" bundle:nil] autorelease]; + break; + case 1: + viewController = [[[QueueViewController alloc] initWithNibName:@"Sample" bundle:nil] autorelease]; + break; + case 2: + viewController = [[[AuthenticationViewController alloc] initWithNibName:@"Sample" bundle:nil] autorelease]; + break; + case 3: + viewController = [[[UploadViewController alloc] initWithNibName:@"Sample" bundle:nil] autorelease]; + break; + } + [splitViewController setViewControllers:[NSArray arrayWithObjects:[self navigationController],viewController,nil]]; + + // Dismiss the popover if it's present. + if ([self popoverController]) { + [[self popoverController] dismissPopoverAnimated:YES]; + } + + // Configure the new view controller's popover button (after the view has been displayed and its toolbar/navigation bar has been created). + if ([self rootPopoverButtonItem]) { + [[[(id)viewController navigationBar] topItem] setLeftBarButtonItem:[self rootPopoverButtonItem] animated:NO]; + } + +} + +- (void)splitViewController:(UISplitViewController*)svc willHideViewController:(UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem*)barButtonItem forPopoverController:(UIPopoverController*)pc +{ + [barButtonItem setTitle:@"More Examples"]; + [self setPopoverController:pc]; + [self setRootPopoverButtonItem:barButtonItem]; + SampleViewController *detailViewController = [[splitViewController viewControllers] objectAtIndex:1]; + [detailViewController showNavigationButton:barButtonItem]; +} + +- (void)splitViewController:(UISplitViewController*)svc willShowViewController:(UIViewController *)aViewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem +{ + [self setPopoverController:nil]; + [self setRootPopoverButtonItem:nil]; + SampleViewController *detailViewController = [[splitViewController viewControllers] objectAtIndex:1]; + [detailViewController hideNavigationButton:barButtonItem]; +} + +- (void)splitViewController:(UISplitViewController *)svc popoverController: (UIPopoverController *)pc willPresentViewController: (UIViewController *)aViewController +{ + if (pc != nil) { + [pc dismissPopoverAnimated:YES]; + } +} + + +@synthesize splitViewController; +@synthesize popoverController; +@synthesize rootPopoverButtonItem; +@end diff --git a/iPhone Sample/SampleViewController.h b/iPhone Sample/SampleViewController.h new file mode 100644 index 00000000..d9d08b2b --- /dev/null +++ b/iPhone Sample/SampleViewController.h @@ -0,0 +1,22 @@ +// +// SampleViewController.h +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details +// +// Created by Ben Copsey on 17/06/2010. +// Copyright 2010 All-Seeing Interactive. All rights reserved. +// + +#import + + +@interface SampleViewController : UIViewController { + UINavigationBar *navigationBar; + UITableView *tableView; +} + +- (void)showNavigationButton:(UIBarButtonItem *)button; +- (void)hideNavigationButton:(UIBarButtonItem *)button; + +@property (retain, nonatomic) IBOutlet UINavigationBar *navigationBar; +@property (retain, nonatomic) IBOutlet UITableView *tableView; +@end diff --git a/iPhone Sample/SampleViewController.m b/iPhone Sample/SampleViewController.m new file mode 100644 index 00000000..a6697a31 --- /dev/null +++ b/iPhone Sample/SampleViewController.m @@ -0,0 +1,55 @@ +// +// SampleViewController.m +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details +// +// Created by Ben Copsey on 17/06/2010. +// Copyright 2010 All-Seeing Interactive. All rights reserved. +// + +#import "SampleViewController.h" + + +@implementation SampleViewController + +- (void)showNavigationButton:(UIBarButtonItem *)button +{ + [[[self navigationBar] topItem] setLeftBarButtonItem:button animated:NO]; +} + +- (void)hideNavigationButton:(UIBarButtonItem *)button +{ + [[[self navigationBar] topItem] setLeftBarButtonItem:nil animated:NO]; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + +- (NSIndexPath *)tableView:(UITableView *)theTableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + return nil; +} + +- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation +{ + [[self tableView] reloadData]; +} + + +- (void)viewDidUnload { + [super viewDidUnload]; + [self setNavigationBar:nil]; + [self setTableView:nil]; +} + + +- (void)dealloc { + [navigationBar release]; + [tableView release]; + [super dealloc]; +} + +@synthesize navigationBar; +@synthesize tableView; +@end diff --git a/iPhone Sample/SynchronousViewController.h b/iPhone Sample/SynchronousViewController.h index 6b7e5892..a619a5d0 100644 --- a/iPhone Sample/SynchronousViewController.h +++ b/iPhone Sample/SynchronousViewController.h @@ -1,17 +1,23 @@ // // SynchronousViewController.h -// asi-http-request +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details // // Created by Ben Copsey on 07/11/2008. // Copyright 2008 All-Seeing Interactive. All rights reserved. // #import +#import "SampleViewController.h" +@class ASIHTTPRequest; +@interface SynchronousViewController : SampleViewController { + ASIHTTPRequest *request; + UITextField *urlField; + UITextView *responseField; -@interface SynchronousViewController : UIViewController { - IBOutlet UITextView *htmlSource; } - (IBAction)simpleURLFetch:(id)sender; +@property (retain, nonatomic) ASIHTTPRequest *request; + @end diff --git a/iPhone Sample/SynchronousViewController.m b/iPhone Sample/SynchronousViewController.m index 15f937e4..65b9efd4 100644 --- a/iPhone Sample/SynchronousViewController.m +++ b/iPhone Sample/SynchronousViewController.m @@ -1,6 +1,6 @@ // // SynchronousViewController.m -// asi-http-request +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details // // Created by Ben Copsey on 07/11/2008. // Copyright 2008 All-Seeing Interactive. All rights reserved. @@ -8,23 +8,183 @@ #import "SynchronousViewController.h" #import "ASIHTTPRequest.h" +#import "DetailCell.h" +#import "InfoCell.h" @implementation SynchronousViewController + +// Runs a request synchronously - (IBAction)simpleURLFetch:(id)sender { - ASIHTTPRequest *request = [[[ASIHTTPRequest alloc] initWithURL:[NSURL URLWithString:@"http://allseeing-i.com/"]] autorelease]; + + NSURL *url = [NSURL URLWithString:[urlField text]]; + // Create a request + // You don't normally need to retain a synchronous request, but we need to in this case because we'll need it later if we reload the table data + [self setRequest:[ASIHTTPRequest requestWithURL:url]]; //Customise our user agent, for no real reason [request addRequestHeader:@"User-Agent" value:@"ASIHTTPRequest"]; + // Start the request [request startSynchronous]; - if ([request error]) { - [htmlSource setText:[[request error] localizedDescription]]; - } else if ([request responseString]) { - [htmlSource setText:[request responseString]]; + + // Request has now finished + [[self tableView] reloadData]; + +} + +/* +Most of the code below here relates to the table view, and isn't that interesting +*/ + +- (void)viewDidLoad +{ + [[[self navigationBar] topItem] setTitle:@"Synchronous Requests"]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; + +} + + +- (void)dealloc +{ + [request cancel]; + [request release]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil]; + [super dealloc]; +} + +- (void)keyboardWillShow:(NSNotification *)notification +{ + NSValue *keyboardBoundsValue = [[notification userInfo] objectForKey:UIKeyboardBoundsUserInfoKey]; + CGRect keyboardBounds; + [keyboardBoundsValue getValue:&keyboardBounds]; + UIEdgeInsets e = UIEdgeInsetsMake(0, 0, keyboardBounds.size.height-42, 0); + [[self tableView] setScrollIndicatorInsets:e]; + [[self tableView] setContentInset:e]; +} + +- (void)keyboardWillHide:(NSNotification *)notification +{ + UIEdgeInsets e = UIEdgeInsetsMake(0, 0, 0, 0); + [[self tableView] setScrollIndicatorInsets:e]; + [[self tableView] setContentInset:e]; +} + +static NSString *intro = @"Demonstrates fetching a web page synchronously, the HTML source will appear in the box below when the download is complete. The interface will lock up when you press this button until the operation times out or succeeds. You should avoid using synchronous requests on the main thread, even for the simplest operations."; + +- (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell; + if ([indexPath section] == 0) { + cell = [InfoCell cellWithDescription:intro]; + } else if ([indexPath section] == 3) { + cell = [tableView dequeueReusableCellWithIdentifier:@"HeaderCell"]; + if (!cell) { + cell = [DetailCell cell]; + } + } else { + cell = [tableView dequeueReusableCellWithIdentifier:@"MyCell"]; + if (!cell) { + cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MyCell"] autorelease]; + } } + [cell setSelectionStyle:UITableViewCellSelectionStyleNone]; + NSString *key; + + int tablePadding = 40; + int tableWidth = [tableView frame].size.width; + if (tableWidth > 480) { // iPad + tablePadding = 110; + } + + switch ([indexPath section]) { + case 1: + urlField = [[[UITextField alloc] initWithFrame:CGRectMake(10,12,tableWidth-tablePadding-40,20)] autorelease]; + if ([self request]) { + [urlField setText:[[[self request] url] absoluteString]]; + } else { + [urlField setText:@"http://allseeing-i.com"]; + } + UIButton *goButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; + [goButton setFrame:CGRectMake(tableWidth-tablePadding-38,7,20,20)]; + [goButton setTitle:@"Go!" forState:UIControlStateNormal]; + [goButton sizeToFit]; + [goButton addTarget:self action:@selector(simpleURLFetch:) forControlEvents:UIControlEventTouchUpInside]; + [[cell contentView] addSubview:goButton]; + [[cell contentView] addSubview:urlField]; + break; + case 2: + + responseField = [[[UITextView alloc] initWithFrame:CGRectMake(5,5,tableWidth-tablePadding,150)] autorelease]; + [responseField setBackgroundColor:[UIColor clearColor]]; + [[cell contentView] addSubview:responseField]; + if (request) { + if ([request error]) { + [responseField setText:[[request error] localizedDescription]]; + } else if ([request responseString]) { + [responseField setText:[request responseString]]; + } + } + break; + case 3: + key = [[[request responseHeaders] allKeys] objectAtIndex:[indexPath row]]; + [[cell textLabel] setText:key]; + [[cell detailTextLabel] setText:[[request responseHeaders] objectForKey:key]]; + break; + } + return cell; +} + +- (NSInteger)tableView:(UITableView *)theTableView numberOfRowsInSection:(NSInteger)section +{ + if (section == 3) { + return [[request responseHeaders] count]; + } else { + return 1; + } +} + +- (CGFloat)tableView:(UITableView *)theTableView heightForRowAtIndexPath:(NSIndexPath *)indexPath +{ + if ([indexPath section] == 0) { + return [InfoCell neededHeightForDescription:intro withTableWidth:[tableView frame].size.width]+20; + } else if ([indexPath section] == 1) { + return 48; + } else if ([indexPath section] == 2) { + return 160; + } else { + return 34; + } +} + +- (NSString *)tableView:(UITableView *)theTableView titleForHeaderInSection:(NSInteger)section +{ + switch (section) { + case 0: + return nil; + case 1: + return @"Enter a URL"; + case 2: + return @"Response"; + case 3: + return @"Response Headers"; + } + return nil; } +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + if ([self request]) { + return 4; + } else { + return 2; + } +} + + +@synthesize request; @end diff --git a/iPhone Sample/ToggleCell.h b/iPhone Sample/ToggleCell.h new file mode 100644 index 00000000..743d628b --- /dev/null +++ b/iPhone Sample/ToggleCell.h @@ -0,0 +1,18 @@ +// +// ToggleCell.h +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details +// +// Created by Ben Copsey on 17/06/2010. +// Copyright 2010 All-Seeing Interactive. All rights reserved. +// + +#import + + +@interface ToggleCell : UITableViewCell { + UISwitch *toggle; +} ++ (id)cell; + +@property (assign, nonatomic) UISwitch *toggle; +@end diff --git a/iPhone Sample/ToggleCell.m b/iPhone Sample/ToggleCell.m new file mode 100644 index 00000000..321a1a50 --- /dev/null +++ b/iPhone Sample/ToggleCell.m @@ -0,0 +1,24 @@ +// +// ToggleCell.m +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details +// +// Created by Ben Copsey on 17/06/2010. +// Copyright 2010 All-Seeing Interactive. All rights reserved. +// + +#import "ToggleCell.h" + + +@implementation ToggleCell + ++ (id)cell +{ + ToggleCell *cell = [[[ToggleCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"ToggleCell"] autorelease]; + [[cell textLabel] setTextAlignment:UITextAlignmentLeft]; + [cell setToggle:[[[UISwitch alloc] initWithFrame:CGRectMake(0,0,20,20)] autorelease]]; + [cell setAccessoryView:[cell toggle]]; + return cell; +} + +@synthesize toggle; +@end diff --git a/iPhone Sample/UploadViewController.h b/iPhone Sample/UploadViewController.h index 0a47d515..2b7a0096 100644 --- a/iPhone Sample/UploadViewController.h +++ b/iPhone Sample/UploadViewController.h @@ -1,20 +1,25 @@ // // UploadViewController.h -// asi-http-request +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details // // Created by Ben Copsey on 31/12/2008. // Copyright 2008 All-Seeing Interactive. All rights reserved. // #import +#import "SampleViewController.h" +@class ASIFormDataRequest; -@class ASINetworkQueue; - -@interface UploadViewController : UIViewController { - ASINetworkQueue *networkQueue; +@interface UploadViewController : SampleViewController { + + ASIFormDataRequest *request; + IBOutlet UIProgressView *progressIndicator; + UITextView *resultView; } - (IBAction)performLargeUpload:(id)sender; - (IBAction)toggleThrottling:(id)sender; + +@property (retain, nonatomic) ASIFormDataRequest *request; @end diff --git a/iPhone Sample/UploadViewController.m b/iPhone Sample/UploadViewController.m index 132ed7ea..88b94655 100644 --- a/iPhone Sample/UploadViewController.m +++ b/iPhone Sample/UploadViewController.m @@ -1,6 +1,6 @@ // // UploadViewController.m -// asi-http-request +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details // // Created by Ben Copsey on 31/12/2008. // Copyright 2008 All-Seeing Interactive. All rights reserved. @@ -8,28 +8,22 @@ #import "UploadViewController.h" #import "ASIFormDataRequest.h" -#import "ASINetworkQueue.h" +#import "InfoCell.h" @implementation UploadViewController - -- (void)awakeFromNib -{ - networkQueue = [[ASINetworkQueue alloc] init]; -} - - (IBAction)performLargeUpload:(id)sender { - [networkQueue cancelAllOperations]; - [networkQueue setShowAccurateProgress:YES]; - [networkQueue setUploadProgressDelegate:progressIndicator]; - [networkQueue setDelegate:self]; - - ASIFormDataRequest *request = [[[ASIFormDataRequest alloc] initWithURL:[NSURL URLWithString:@"http://allseeing-i.com/ignore"]] autorelease]; + [request cancel]; + [self setRequest:[ASIFormDataRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/ignore"]]]; [request setPostValue:@"test" forKey:@"value1"]; [request setPostValue:@"test" forKey:@"value2"]; [request setPostValue:@"test" forKey:@"value3"]; [request setTimeOutSeconds:20]; + [request setUploadProgressDelegate:progressIndicator]; + [request setDelegate:self]; + [request setDidFailSelector:@selector(uploadFailed:)]; + [request setDidFinishSelector:@selector(uploadFinished:)]; //Create a 256KB file NSData *data = [[[NSMutableData alloc] initWithLength:256*1024] autorelease]; @@ -42,8 +36,8 @@ - (IBAction)performLargeUpload:(id)sender [request setFile:path forKey:[NSString stringWithFormat:@"file-%hi",i]]; } - [networkQueue addOperation:request]; - [networkQueue go]; + [request startAsynchronous]; + [resultView setText:@"Uploading data..."]; } - (IBAction)toggleThrottling:(id)sender @@ -51,9 +45,122 @@ - (IBAction)toggleThrottling:(id)sender [ASIHTTPRequest setShouldThrottleBandwidthForWWAN:[(UISwitch *)sender isOn]]; } -- (void)dealloc { - [networkQueue release]; +- (void)uploadFailed:(ASIHTTPRequest *)theRequest +{ + [resultView setText:[NSString stringWithFormat:@"Request failed:\r\n%@",[[theRequest error] localizedDescription]]]; +} + +- (void)uploadFinished:(ASIHTTPRequest *)theRequest +{ + [resultView setText:[NSString stringWithFormat:@"Finished uploading %llu bytes of data",[theRequest postLength]]]; +} + +- (void)dealloc +{ + [request cancel]; + [request release]; [super dealloc]; } +/* + Most of the code below here relates to the table view, and isn't that interesting + */ + +- (void)viewDidLoad +{ + [[[self navigationBar] topItem] setTitle:@"Tracking Upload Progress"]; +} + +static NSString *intro = @"Demonstrates POSTing content to a URL, showing upload progress.\nYou'll only see accurate progress for uploads when the request body is larger than 128KB (in 2.2.1 SDK), or when the request body is larger than 32KB (in 3.0 SDK)"; + +- (UIView *)tableView:(UITableView *)theTableView viewForHeaderInSection:(NSInteger)section +{ + if (section == 1) { + int tablePadding = 40; + int tableWidth = [tableView frame].size.width; + if (tableWidth > 480) { // iPad + tablePadding = 110; + } + + UIView *view = [[[UIView alloc] initWithFrame:CGRectMake(0,0,tableWidth-(tablePadding/2),30)] autorelease]; + UIButton *goButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; + [goButton setTitle:@"Go!" forState:UIControlStateNormal]; + [goButton sizeToFit]; + [goButton setFrame:CGRectMake([view frame].size.width-[goButton frame].size.width+10,7,[goButton frame].size.width,[goButton frame].size.height)]; + + [goButton addTarget:self action:@selector(performLargeUpload:) forControlEvents:UIControlEventTouchUpInside]; + [view addSubview:goButton]; + + progressIndicator = [[[UIProgressView alloc] initWithFrame:CGRectMake((tablePadding/2)-10,20,200,10)] autorelease]; + [view addSubview:progressIndicator]; + + return view; + } + return nil; +} + +- (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell; + if ([indexPath section] == 0) { + cell = [InfoCell cellWithDescription:intro]; + } else { + cell = [tableView dequeueReusableCellWithIdentifier:@"MyCell"]; + if (!cell) { + cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MyCell"] autorelease]; + } + } + [cell setSelectionStyle:UITableViewCellSelectionStyleNone]; + + int tablePadding = 40; + int tableWidth = [tableView frame].size.width; + if (tableWidth > 480) { // iPad + tablePadding = 110; + } + + switch ([indexPath section]) { + + case 2: + + resultView = [[[UITextView alloc] initWithFrame:CGRectMake(5,5,tableWidth-tablePadding,60)] autorelease]; + [resultView setBackgroundColor:[UIColor clearColor]]; + [[cell contentView] addSubview:resultView]; + break; + } + return cell; +} + +- (NSInteger)tableView:(UITableView *)theTableView numberOfRowsInSection:(NSInteger)section +{ + if (section == 1) { + return 0; + } + return 1; +} + +- (CGFloat)tableView:(UITableView *)theTableView heightForHeaderInSection:(NSInteger)section +{ + if (section == 1) { + return 50; + } + return 34; +} + +- (CGFloat)tableView:(UITableView *)theTableView heightForRowAtIndexPath:(NSIndexPath *)indexPath +{ + if ([indexPath section] == 0) { + return [InfoCell neededHeightForDescription:intro withTableWidth:[tableView frame].size.width]+20; + } else if ([indexPath section] == 2) { + return 80; + } else { + return 42; + } +} + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 3; +} + +@synthesize request; @end diff --git a/iPhone Sample/XIBs/Authentication.xib b/iPhone Sample/XIBs/Authentication.xib deleted file mode 100644 index 52ec212f..00000000 --- a/iPhone Sample/XIBs/Authentication.xib +++ /dev/null @@ -1,647 +0,0 @@ - - - - 768 - 10C540 - 740 - 1038.25 - 458.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 62 - - - YES - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - - - IBFirstResponder - - - - 292 - - YES - - - 292 - {{205, 90}, {94, 27}} - - NO - YES - YES - 0 - 0 - - - - 292 - {{16, 96}, {75, 21}} - - NO - YES - NO - Keychain: - - 1 - MCAwIDAAA - - - 1 - 10 - - - - 292 - {{205, 125}, {94, 27}} - - NO - YES - YES - 0 - 0 - YES - - - - 292 - {{16, 128}, {144, 21}} - - NO - YES - NO - Use built-in dialog: - - - 1 - 10 - - - - 292 - {{16, 310}, {72, 37}} - - NO - NO - 0 - 0 - - Helvetica-Bold - 15 - 16 - - 1 - Go! - - 3 - MQA - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - 3 - MC41AA - - - - - 292 - {{16, 6}, {280, 79}} - - NO - YES - NO - Demonstrates fetching content from an area that requires HTTP authentication. You will be prompted for a username and password, enter 'topsecret' for both. - - Helvetica - 14 - 16 - - - - 1 - NO - 10 - 7 - - - - 292 - {{16, 349}, {280, 33}} - - NO - YES - NO - Top secret information will not appear here - - Helvetica - 13 - 16 - - - - 1 - NO - 10 - 7 - - - - 292 - {{16, 160}, {280, 84}} - - NO - YES - NO - 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. - - - - 1 - NO - 10 - 7 - - - - 292 - {{16, 249}, {280, 54}} - - NO - YES - NO - Toggle 'Use built-in dialog' to switch between ASIHTTPRequest's built-in dialog, and one created by the delegate. - - - - 1 - NO - 10 - 7 - - - {320, 460} - - - 3 - MQA - - 2 - - - - - - - - YES - - - view - - - - 3 - - - - useKeychain - - - - 11 - - - - fetchTopSecretInformation: - - - 7 - - 12 - - - - topSecretInfo - - - - 17 - - - - useBuiltInDialog - - - - 25 - - - - - YES - - 0 - - - - - - 1 - - - YES - - - - - - - - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 6 - - - - - 7 - - - - - 10 - - - - - 14 - - - - - 16 - - - - - 21 - - - - - 22 - - - - - 23 - - - - - 24 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - 10.IBPluginDependency - 14.IBPluginDependency - 16.IBPluginDependency - 21.IBPluginDependency - 22.IBPluginDependency - 23.IBPluginDependency - 24.IBPluginDependency - 6.IBPluginDependency - 7.IBPluginDependency - - - YES - AuthenticationViewController - UIResponder - {{978, 373}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - YES - - - - - YES - - - YES - - - - 25 - - - - YES - - AuthenticationViewController - UIViewController - - fetchTopSecretInformation: - id - - - YES - - YES - topSecretInfo - useBuiltInDialog - useKeychain - - - YES - UILabel - UISwitch - UISwitch - - - - IBProjectSource - iPhone Sample/AuthenticationViewController.h - - - - NSObject - - IBProjectSource - Frameworks/libGHUnitIPhone3_0-0/GHUNSObject+Swizzle.h - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSNetServices.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPort.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSStream.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSXMLParser.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - UIButton - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UIButton.h - - - - UIControl - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIControl.h - - - - UILabel - UIView - - IBFrameworkSource - UIKit.framework/Headers/UILabel.h - - - - UIResponder - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISwitch - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UISwitch.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - - 0 - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - ../../iPhone.xcodeproj - 3 - 3.1 - - diff --git a/iPhone Sample/XIBs/Queue.xib b/iPhone Sample/XIBs/Queue.xib deleted file mode 100644 index a1b4f682..00000000 --- a/iPhone Sample/XIBs/Queue.xib +++ /dev/null @@ -1,679 +0,0 @@ - - - - 528 - 10C540 - 740 - 1038.25 - 458.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 62 - - - YES - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - - - IBFirstResponder - - - - 274 - - YES - - - 292 - {{16, 6}, {280, 54}} - - NO - YES - NO - Demonstrates a fetching 3 items at once, using an ASINetworkQueue to track progress. - - Helvetica - 14 - 16 - - - 1 - MCAwIDAAA - - - 1 - 10 - 0 - - - - 292 - {{159, 258}, {143, 87}} - - - 3 - MCAwAA - - NO - YES - NO - See the Mac sample app for a slightly more sophisticated example, with an addtional progress indicator for each request - - Helvetica - 12 - 16 - - - - 1 - 10 - 0 - - - - 292 - {{16, 74}, {72, 37}} - - NO - NO - 0 - 0 - - Helvetica-Bold - 15 - 16 - - 1 - Go! - Go! - Go! - Go! - - 1 - MSAxIDEAA - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - 3 - MAA - - - - - 292 - {{16, 163}, {135, 87}} - - - 1 - MC42MzY2MTA2MzAzIDAuNDg4ODk3MzUxNSAwLjcwMTA4Njk1NjUgMC41MgA - - NO - NO - 1 - NO - - - - 292 - {{16, 258}, {135, 87}} - - - 1 - MC42MzY2MTA2MzAzIDAuNDg4ODk3MzUxNSAwLjcwMTA4Njk1NjUgMC41MgA - - NO - NO - 1 - NO - - - - 292 - {{159, 163}, {137, 87}} - - - 1 - MC42MzY2MTA2MzAzIDAuNDg4ODk3MzUxNSAwLjcwMTA4Njk1NjUgMC41MgA - - NO - NO - 1 - NO - - - - 292 - {{16, 353}, {280, 9}} - - NO - YES - YES - - - - 292 - {{179, 122}, {94, 27}} - - NO - YES - YES - 0 - 0 - - - - 292 - {{16, 126}, {143, 21}} - - NO - YES - NO - Accurate progress: - - - 1 - 10 - - - {320, 460} - - - 3 - MQA - - 2 - - - - - - - - YES - - - view - - - - 3 - - - - imageView1 - - - - 15 - - - - imageView2 - - - - 16 - - - - imageView3 - - - - 17 - - - - progressIndicator - - - - 18 - - - - fetchThreeImages: - - - 7 - - 20 - - - - accurateProgress - - - - 23 - - - - - YES - - 0 - - - - - - 1 - - - YES - - - - - - - - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 8 - - - - - 9 - - - - - 11 - - - - - 12 - - - - - 13 - - - - - 14 - - - - - 21 - - - - - 22 - - - - - 24 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - 11.IBPluginDependency - 12.IBPluginDependency - 13.IBPluginDependency - 14.IBPluginDependency - 21.IBPluginDependency - 22.IBPluginDependency - 24.IBPluginDependency - 8.IBPluginDependency - 9.IBPluginDependency - - - YES - QueueViewController - UIResponder - {{639, 368}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - YES - - - - - YES - - - YES - - - - 24 - - - - YES - - NSObject - - IBProjectSource - Frameworks/libGHUnitIPhone3_0-0/GHUNSObject+Swizzle.h - - - - QueueViewController - UIViewController - - fetchThreeImages: - id - - - YES - - YES - accurateProgress - imageView1 - imageView2 - imageView3 - progressIndicator - - - YES - UISwitch - UIImageView - UIImageView - UIImageView - UIProgressView - - - - IBProjectSource - iPhone Sample/QueueViewController.h - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSNetServices.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPort.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSStream.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSXMLParser.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - UIButton - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UIButton.h - - - - UIControl - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIControl.h - - - - UIImageView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIImageView.h - - - - UILabel - UIView - - IBFrameworkSource - UIKit.framework/Headers/UILabel.h - - - - UIProgressView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIProgressView.h - - - - UIResponder - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISwitch - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UISwitch.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - - 0 - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - ../../iPhone.xcodeproj - 3 - 3.1 - - diff --git a/iPhone Sample/XIBs/Synchronous.xib b/iPhone Sample/XIBs/Synchronous.xib deleted file mode 100644 index 748c2f0c..00000000 --- a/iPhone Sample/XIBs/Synchronous.xib +++ /dev/null @@ -1,529 +0,0 @@ - - - - 528 - 10C540 - 740 - 1038.25 - 458.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 62 - - - YES - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - - - IBFirstResponder - - - - 274 - - YES - - - 292 - {{17, 35}, {280, 144}} - - NO - YES - NO - Demonstrates fetching a web page synchronously, the HTML source will appear in the box below when the download is complete. The interface will lock up when you press this button until the operation times out or succeeds. In real world situations, you'd be more likely to use synchronous requests in a thread. - - Helvetica - 14 - 16 - - - 1 - MCAwIDAAA - - - 1 - 10 - 0 - - - - 292 - {{17, 187}, {72, 37}} - - NO - NO - 0 - 0 - - Helvetica-Bold - 15 - 16 - - 1 - Go! - Go! - Go! - Go! - - 1 - MSAxIDEAA - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - 3 - MAA - - - - - 292 - {{17, 232}, {280, 120}} - - - 1 - MC44MDk3ODI2MDg3IDAuODA5NzgyNjA4NyAwLjgwOTc4MjYwODcgMC4zAA - - NO - YES - YES - NO - 1 - NO - NO - NO - NO - HTML source will be here - - Helvetica - 12 - 16 - - - - - - 292 - {{16, 6}, {286, 21}} - - NO - YES - NO - (There are more examples in the Mac project) - - Helvetica-Bold - 13 - 16 - - - - 1 - 10 - - - {320, 460} - - - 3 - MQA - - 2 - - - - - - - - YES - - - view - - - - 3 - - - - simpleURLFetch: - - - 7 - - 12 - - - - htmlSource - - - - 13 - - - - - YES - - 0 - - - - - - 1 - - - YES - - - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 8 - - - - - 9 - - - - - 10 - - - - - 14 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - 10.IBPluginDependency - 14.IBPluginDependency - 8.IBPluginDependency - 9.IBPluginDependency - - - YES - SynchronousViewController - UIResponder - {{639, 372}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - YES - - - - - YES - - - YES - - - - 14 - - - - YES - - NSObject - - IBProjectSource - Frameworks/libGHUnitIPhone3_0-0/GHUNSObject+Swizzle.h - - - - SynchronousViewController - UIViewController - - simpleURLFetch: - id - - - htmlSource - UITextView - - - IBProjectSource - iPhone Sample/SynchronousViewController.h - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSNetServices.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPort.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSStream.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSXMLParser.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - UIButton - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UIButton.h - - - - UIControl - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIControl.h - - - - UILabel - UIView - - IBFrameworkSource - UIKit.framework/Headers/UILabel.h - - - - UIResponder - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIScrollView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIScrollView.h - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UITextView - UIScrollView - - IBFrameworkSource - UIKit.framework/Headers/UITextView.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - - 0 - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - ../../iPhone.xcodeproj - 3 - 3.1 - - diff --git a/iPhone Sample/XIBs/UploadProgress.xib b/iPhone Sample/XIBs/UploadProgress.xib deleted file mode 100644 index 39f0ff90..00000000 --- a/iPhone Sample/XIBs/UploadProgress.xib +++ /dev/null @@ -1,578 +0,0 @@ - - - - 528 - 10C540 - 740 - 1038.25 - 458.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 62 - - - YES - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - - - IBFirstResponder - - - - 292 - - YES - - - 292 - {{16, 6}, {280, 144}} - - NO - YES - NO - RGVtb25zdHJhdGVzIFBPU1RpbmcgY29udGVudCB0byBhIFVSTCwgc2hvd2luZyB1cGxvYWQgcHJvZ3Jl -c3MuCgpZb3UnbGwgb25seSBzZWUgYWNjdXJhdGUgcHJvZ3Jlc3MgZm9yIHVwbG9hZHMgd2hlbiB0aGUg -cmVxdWVzdCBib2R5IGlzIGxhcmdlciB0aGFuIDEyOEtCIChpbiAyLjIuMSBTREspLCBvciB3aGVuIHRo -ZSByZXF1ZXN0IGJvZHkgaXMgbGFyZ2VyIHRoYW4gMzJLQiAoaW4gMy4wIFNESyk - - Helvetica - 14 - 16 - - - 1 - MCAwIDAAA - - - 1 - 10 - 0 - 0 - - - - 292 - {{16, 175}, {72, 37}} - - NO - NO - 0 - 0 - - Helvetica-Bold - 15 - 16 - - 1 - Go! - Go! - Go! - Go! - - 1 - MSAxIDEAA - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - 3 - MAA - - - - - 292 - {{16, 229}, {280, 9}} - - NO - YES - YES - - - - 292 - {{203, 255}, {94, 27}} - - NO - YES - YES - 0 - 0 - - - - 292 - {{16, 258}, {207, 21}} - - NO - YES - NO - Throttle WWAN bandwidth: - - - - 1 - 10 - - - - 292 - {{16, 290}, {266, 68}} - - NO - YES - NO - VGhpcyBpcyBhIGdsb2JhbCBzZXR0aW5nIHRoYXQgYWZmZWN0cyBhbGwgcmVxdWVzdHMKCkJhbmR3aWR0 -aCB3aWxsIGJlIHJlZHVjZWQgb25seSB3aGVuIHlvdSBhcmUgbm90IGNvbm5lY3RlZCB0byBXaUZpLg - - Helvetica - 12 - 16 - - - - 1 - 10 - 4 - 0 - - - {320, 480} - - - 3 - MQA - - 2 - - - - - - - YES - - - performLargeUpload: - - - 7 - - 7 - - - - view - - - - 9 - - - - progressIndicator - - - - 11 - - - - toggleThrottling: - - - 13 - - 15 - - - - - YES - - 0 - - - - - - 1 - - - YES - - - - - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 4 - - - - - 6 - - - - - 10 - - - - - 12 - - - - - 13 - - - - - 16 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - 10.IBPluginDependency - 12.IBPluginDependency - 13.IBPluginDependency - 16.IBPluginDependency - 4.IBPluginDependency - 6.IBPluginDependency - - - YES - UploadViewController - UIResponder - {{325, 167}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - YES - - - - - YES - - - YES - - - - 16 - - - - YES - - NSObject - - IBProjectSource - Frameworks/libGHUnitIPhone3_0-0/GHUNSObject+Swizzle.h - - - - UploadViewController - UIViewController - - YES - - YES - performLargeUpload: - toggleThrottling: - - - YES - id - id - - - - progressIndicator - UIProgressView - - - IBProjectSource - iPhone Sample/UploadViewController.h - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSNetServices.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPort.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSStream.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSXMLParser.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - UIButton - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UIButton.h - - - - UIControl - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIControl.h - - - - UILabel - UIView - - IBFrameworkSource - UIKit.framework/Headers/UILabel.h - - - - UIProgressView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIProgressView.h - - - - UIResponder - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISwitch - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UISwitch.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - - 0 - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - ../../iPhone.xcodeproj - 3 - 3.1 - - diff --git a/iPhone Sample/Info.plist b/iPhone Sample/iPadInfo.plist similarity index 87% rename from iPhone Sample/Info.plist rename to iPhone Sample/iPadInfo.plist index 3c1d72e5..edd661f7 100644 --- a/iPhone Sample/Info.plist +++ b/iPhone Sample/iPadInfo.plist @@ -4,12 +4,14 @@ CFBundleDevelopmentRegion English + CFBundleDisplayName + ASIHTTPRequest Demo CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFile iphone-icon.png CFBundleIdentifier - com.allseeinginteractive.asihttprequest.sample + com.allseeinginteractive.asihttprequest.ipad.sample CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType @@ -19,8 +21,6 @@ CFBundleVersion 1.0 NSMainNibFile - MainWindow - CFBundleDisplayName - ASIHTTPRequest Demo + iPadMainWindow diff --git a/iPhone Sample/iPadSampleAppDelegate.h b/iPhone Sample/iPadSampleAppDelegate.h new file mode 100644 index 00000000..ed2326b0 --- /dev/null +++ b/iPhone Sample/iPadSampleAppDelegate.h @@ -0,0 +1,19 @@ +// +// iPadSampleAppDelegate.h +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details +// +// Created by Ben Copsey on 15/06/2010. +// Copyright 2010 All-Seeing Interactive. All rights reserved. +// + +#import + +@interface iPadSampleAppDelegate : NSObject { + UIWindow *window; + UISplitViewController *splitViewController; +} + +@property (nonatomic, retain) IBOutlet UIWindow *window; +@property (nonatomic, retain) IBOutlet UISplitViewController *splitViewController; + +@end diff --git a/iPhone Sample/iPadSampleAppDelegate.m b/iPhone Sample/iPadSampleAppDelegate.m new file mode 100644 index 00000000..7d028d95 --- /dev/null +++ b/iPhone Sample/iPadSampleAppDelegate.m @@ -0,0 +1,28 @@ +// +// iPadSampleAppDelegate.m +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details +// +// Created by Ben Copsey on 15/06/2010. +// Copyright 2010 All-Seeing Interactive. All rights reserved. +// + +#import "iPadSampleAppDelegate.h" + +@implementation iPadSampleAppDelegate + +- (void)applicationDidFinishLaunching:(UIApplication *)application +{ + [window addSubview:[splitViewController view]]; + [window makeKeyAndVisible]; +} + +- (void)dealloc { + [splitViewController release]; + [window release]; + [super dealloc]; +} + + +@synthesize window; +@synthesize splitViewController; +@end diff --git a/iPhone Sample/iPhoneInfo.plist b/iPhone Sample/iPhoneInfo.plist new file mode 100644 index 00000000..e47caae1 --- /dev/null +++ b/iPhone Sample/iPhoneInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDisplayName + ASIHTTPRequest Demo + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + iphone-icon.png + CFBundleIdentifier + com.allseeinginteractive.asihttprequest.iphone.sample + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + NSMainNibFile + iPhoneMainWindow + + diff --git a/iPhone Sample/iPhoneSampleAppDelegate.h b/iPhone Sample/iPhoneSampleAppDelegate.h index e57ea8e9..2c52c355 100644 --- a/iPhone Sample/iPhoneSampleAppDelegate.h +++ b/iPhone Sample/iPhoneSampleAppDelegate.h @@ -1,6 +1,6 @@ // // iPhoneSampleAppDelegate.h -// asi-http-request +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details // // Created by Ben Copsey on 07/11/2008. // Copyright All-Seeing Interactive 2008. All rights reserved. @@ -15,7 +15,6 @@ } - @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet UITabBarController *tabBarController; diff --git a/iPhone Sample/iPhoneSampleAppDelegate.m b/iPhone Sample/iPhoneSampleAppDelegate.m index 71c95ca7..92bb9795 100644 --- a/iPhone Sample/iPhoneSampleAppDelegate.m +++ b/iPhone Sample/iPhoneSampleAppDelegate.m @@ -1,6 +1,6 @@ // // iPhoneSampleAppDelegate.m -// asi-http-request +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details // // Created by Ben Copsey on 07/11/2008. // Copyright All-Seeing Interactive 2008. All rights reserved. @@ -12,12 +12,8 @@ @implementation iPhoneSampleAppDelegate -@synthesize window; -@synthesize tabBarController; - - - -- (void)dealloc { +- (void)dealloc +{ [tabBarController release]; [window release]; [super dealloc]; @@ -26,7 +22,7 @@ - (void)dealloc { - (void)applicationDidFinishLaunching:(UIApplication *)application { // Add the tab bar controller's current view as a subview of the window [window addSubview:[tabBarController view]]; - [[tabBarController view] setFrame:CGRectMake(0,47,320,433)]; + [[tabBarController view] setFrame:CGRectMake(0,42,320,438)]; [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(updateStatus:) userInfo:nil repeats:YES]; } @@ -47,5 +43,8 @@ - (void)updateStatus:(NSTimer *)timer } +@synthesize window; +@synthesize tabBarController; + @end diff --git a/iPhone Sample/main.m b/iPhone Sample/main.m index 453ac6aa..1dea1181 100644 --- a/iPhone Sample/main.m +++ b/iPhone Sample/main.m @@ -1,6 +1,6 @@ // // main.m -// iPhone +// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details // // Created by Ben Copsey on 22/03/2009. // Copyright All-Seeing Interactive 2009. All rights reserved. diff --git a/iPhone.xcodeproj/project.pbxproj b/iPhone.xcodeproj/project.pbxproj index d9e4a0a5..73d77c6c 100644 --- a/iPhone.xcodeproj/project.pbxproj +++ b/iPhone.xcodeproj/project.pbxproj @@ -7,10 +7,21 @@ objects = { /* Begin PBXBuildFile section */ - B51791951024C3DA00583567 /* Authentication.xib in Resources */ = {isa = PBXBuildFile; fileRef = B51791941024C3DA00583567 /* Authentication.xib */; }; B51791A31024C3E800583567 /* AuthenticationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B51791A21024C3E800583567 /* AuthenticationViewController.m */; }; B522DACE1030B2AB009A2D22 /* ASIInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = B522DACD1030B2AB009A2D22 /* ASIInputStream.m */; }; B522DACF1030B2AB009A2D22 /* ASIInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = B522DACD1030B2AB009A2D22 /* ASIInputStream.m */; }; + B5231FAA11C9148B006C6E5A /* DetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = B5231FA911C9148B006C6E5A /* DetailCell.m */; }; + B523200F11C9191C006C6E5A /* DetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = B5231FA911C9148B006C6E5A /* DetailCell.m */; }; + B52322C411C94702006C6E5A /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B52322C311C94702006C6E5A /* RootViewController.m */; }; + B52324F811C9FF9D006C6E5A /* SampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B52324F711C9FF9D006C6E5A /* SampleViewController.m */; }; + B52324F911C9FF9D006C6E5A /* SampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B52324F711C9FF9D006C6E5A /* SampleViewController.m */; }; + B523254211CA01F1006C6E5A /* Sample.xib in Resources */ = {isa = PBXBuildFile; fileRef = B523254111CA01F1006C6E5A /* Sample.xib */; }; + B523254311CA01F1006C6E5A /* Sample.xib in Resources */ = {isa = PBXBuildFile; fileRef = B523254111CA01F1006C6E5A /* Sample.xib */; }; + B52325AD11CA05A8006C6E5A /* info.png in Resources */ = {isa = PBXBuildFile; fileRef = B52325AC11CA05A8006C6E5A /* info.png */; }; + B52325B311CA05B0006C6E5A /* InfoCell.m in Sources */ = {isa = PBXBuildFile; fileRef = B52325B211CA05B0006C6E5A /* InfoCell.m */; }; + B52325B411CA05B0006C6E5A /* InfoCell.m in Sources */ = {isa = PBXBuildFile; fileRef = B52325B211CA05B0006C6E5A /* InfoCell.m */; }; + B523264711CA0DEC006C6E5A /* ToggleCell.m in Sources */ = {isa = PBXBuildFile; fileRef = B523264611CA0DEC006C6E5A /* ToggleCell.m */; }; + B523264811CA0DEC006C6E5A /* ToggleCell.m in Sources */ = {isa = PBXBuildFile; fileRef = B523264611CA0DEC006C6E5A /* ToggleCell.m */; }; B5254FF91025F9BF00CF7BC4 /* ProxyTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B5254FF71025F9BF00CF7BC4 /* ProxyTests.m */; }; B52D4A2F10DA4ED5008E8365 /* PerformanceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B52D4A2E10DA4ED5008E8365 /* PerformanceTests.m */; }; B540400B115114BA00D8BE63 /* ASIS3Bucket.m in Sources */ = {isa = PBXBuildFile; fileRef = B5404000115114BA00D8BE63 /* ASIS3Bucket.m */; }; @@ -21,6 +32,7 @@ B54043BB1151546F00D8BE63 /* libGHUnitIPhone3_0.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B54043BA1151546F00D8BE63 /* libGHUnitIPhone3_0.a */; }; B551DCAF10D6A11200EC1CBF /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = B551DCAE10D6A11200EC1CBF /* Reachability.m */; }; B551DCF610D6A8A900EC1CBF /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = B551DCAE10D6A11200EC1CBF /* Reachability.m */; }; + B558B5EB11C7F9C8009B4627 /* iPadMainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = B576D76311C7F4D40059B815 /* iPadMainWindow.xib */; }; B55B604D0F765A320064029C /* ASIFormDataRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B60460F765A320064029C /* ASIFormDataRequest.m */; }; B55B604E0F765A320064029C /* ASIHTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B60480F765A320064029C /* ASIHTTPRequest.m */; }; B55B604F0F765A320064029C /* ASINetworkQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B604A0F765A320064029C /* ASINetworkQueue.m */; }; @@ -31,10 +43,6 @@ B55B60710F765A930064029C /* iPhoneSampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B606B0F765A930064029C /* iPhoneSampleAppDelegate.m */; }; B55B60720F765A930064029C /* UploadViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B606C0F765A930064029C /* UploadViewController.m */; }; B55B60740F765A990064029C /* iphone-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B55B60730F765A990064029C /* iphone-icon.png */; }; - B55B608B0F765AD90064029C /* Queue.xib in Resources */ = {isa = PBXBuildFile; fileRef = B55B60870F765AD90064029C /* Queue.xib */; }; - B55B608C0F765AD90064029C /* UploadProgress.xib in Resources */ = {isa = PBXBuildFile; fileRef = B55B60880F765AD90064029C /* UploadProgress.xib */; }; - B55B608D0F765AD90064029C /* Synchronous.xib in Resources */ = {isa = PBXBuildFile; fileRef = B55B60890F765AD90064029C /* Synchronous.xib */; }; - B55B608E0F765AD90064029C /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = B55B608A0F765AD90064029C /* MainWindow.xib */; }; B55B60CF0F765BBA0064029C /* ASIFormDataRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B60460F765A320064029C /* ASIFormDataRequest.m */; }; B55B60D00F765BBD0064029C /* ASIHTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B60480F765A320064029C /* ASIHTTPRequest.m */; }; B55B60D10F765BC00064029C /* ASINetworkQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B604A0F765A320064029C /* ASINetworkQueue.m */; }; @@ -55,8 +63,30 @@ B576D52311C7CEBC0059B815 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D52211C7CEBC0059B815 /* MobileCoreServices.framework */; }; B576D52511C7CEC00059B815 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D52411C7CEC00059B815 /* UIKit.framework */; }; B576D52D11C7CEFA0059B815 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D52C11C7CEFA0059B815 /* Foundation.framework */; }; - B576D53511C7CF0A0059B815 /* libz.1.1.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D53411C7CF0A0059B815 /* libz.1.1.3.dylib */; }; B576D53E11C7CF350059B815 /* libz.1.2.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D53D11C7CF350059B815 /* libz.1.2.3.dylib */; }; + B576D70411C7F34D0059B815 /* iphone-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B55B60730F765A990064029C /* iphone-icon.png */; }; + B576D70B11C7F34D0059B815 /* ASIFormDataRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B60460F765A320064029C /* ASIFormDataRequest.m */; }; + B576D70C11C7F34D0059B815 /* ASIHTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B60480F765A320064029C /* ASIHTTPRequest.m */; }; + B576D70D11C7F34D0059B815 /* ASINetworkQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B604A0F765A320064029C /* ASINetworkQueue.m */; }; + B576D70E11C7F34D0059B815 /* ASINSStringAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B604C0F765A320064029C /* ASINSStringAdditions.m */; }; + B576D70F11C7F34D0059B815 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B60600F765A750064029C /* main.m */; }; + B576D71011C7F34D0059B815 /* QueueViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B60670F765A930064029C /* QueueViewController.m */; }; + B576D71111C7F34D0059B815 /* SynchronousViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B606A0F765A930064029C /* SynchronousViewController.m */; }; + B576D71211C7F34D0059B815 /* iPhoneSampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B606B0F765A930064029C /* iPhoneSampleAppDelegate.m */; }; + B576D71311C7F34D0059B815 /* UploadViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B606C0F765A930064029C /* UploadViewController.m */; }; + B576D71411C7F34D0059B815 /* AuthenticationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B51791A21024C3E800583567 /* AuthenticationViewController.m */; }; + B576D71511C7F34D0059B815 /* ASIInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = B522DACD1030B2AB009A2D22 /* ASIInputStream.m */; }; + B576D71611C7F34D0059B815 /* ASIAuthenticationDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = B59A87C1103EC6F200300252 /* ASIAuthenticationDialog.m */; }; + B576D71711C7F34D0059B815 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = B551DCAE10D6A11200EC1CBF /* Reachability.m */; }; + B576D71911C7F34D0059B815 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D51E11C7CEB20059B815 /* CFNetwork.framework */; }; + B576D71A11C7F34D0059B815 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D52011C7CEB70059B815 /* SystemConfiguration.framework */; }; + B576D71B11C7F34D0059B815 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D52211C7CEBC0059B815 /* MobileCoreServices.framework */; }; + B576D71C11C7F34D0059B815 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D52411C7CEC00059B815 /* UIKit.framework */; }; + B576D71D11C7F34D0059B815 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D52C11C7CEFA0059B815 /* Foundation.framework */; }; + B576D74A11C7F3E40059B815 /* iPadSampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B576D74911C7F3E40059B815 /* iPadSampleAppDelegate.m */; }; + B576D76611C7F4D90059B815 /* iPhoneMainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = B576D76511C7F4D90059B815 /* iPhoneMainWindow.xib */; }; + B576D77611C7F5810059B815 /* libz.1.2.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D53D11C7CF350059B815 /* libz.1.2.3.dylib */; }; + B576D77711C7F5810059B815 /* libz.1.2.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B576D53D11C7CF350059B815 /* libz.1.2.3.dylib */; }; B5873FD610FF28CA001E145F /* ASIS3BucketObject.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873FC210FF28CA001E145F /* ASIS3BucketObject.m */; }; B5873FD810FF28CA001E145F /* ASIS3Request.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873FC610FF28CA001E145F /* ASIS3Request.m */; }; B5873FD910FF28CA001E145F /* ASICloudFilesCDNRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B5873FC910FF28CA001E145F /* ASICloudFilesCDNRequest.m */; }; @@ -88,12 +118,23 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 1D6058910D05DD3D006BFB54 /* ASIHTTPRequest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ASIHTTPRequest.app; sourceTree = BUILT_PRODUCTS_DIR; }; - B51791941024C3DA00583567 /* Authentication.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Authentication.xib; path = "iPhone Sample/XIBs/Authentication.xib"; sourceTree = ""; }; + 1D6058910D05DD3D006BFB54 /* ASIHTTPRequest iPhone.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ASIHTTPRequest iPhone.app"; sourceTree = BUILT_PRODUCTS_DIR; }; B51791A11024C3E800583567 /* AuthenticationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AuthenticationViewController.h; path = "iPhone Sample/AuthenticationViewController.h"; sourceTree = ""; }; B51791A21024C3E800583567 /* AuthenticationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AuthenticationViewController.m; path = "iPhone Sample/AuthenticationViewController.m"; sourceTree = ""; }; B522DACC1030B2AB009A2D22 /* ASIInputStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIInputStream.h; sourceTree = ""; }; B522DACD1030B2AB009A2D22 /* ASIInputStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASIInputStream.m; sourceTree = ""; }; + B5231FA811C9148B006C6E5A /* DetailCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetailCell.h; sourceTree = ""; }; + B5231FA911C9148B006C6E5A /* DetailCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailCell.m; sourceTree = ""; }; + B52322C211C94702006C6E5A /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = ""; }; + B52322C311C94702006C6E5A /* RootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RootViewController.m; sourceTree = ""; }; + B52324F611C9FF9D006C6E5A /* SampleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleViewController.h; sourceTree = ""; }; + B52324F711C9FF9D006C6E5A /* SampleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SampleViewController.m; sourceTree = ""; }; + B523254111CA01F1006C6E5A /* Sample.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Sample.xib; path = "iPhone Sample/Resources/Sample.xib"; sourceTree = ""; }; + B52325AC11CA05A8006C6E5A /* info.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = info.png; path = "iPhone Sample/Resources/info.png"; sourceTree = ""; }; + B52325B111CA05B0006C6E5A /* InfoCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfoCell.h; sourceTree = ""; }; + B52325B211CA05B0006C6E5A /* InfoCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InfoCell.m; sourceTree = ""; }; + B523264511CA0DEC006C6E5A /* ToggleCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ToggleCell.h; sourceTree = ""; }; + B523264611CA0DEC006C6E5A /* ToggleCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ToggleCell.m; sourceTree = ""; }; B5254FF71025F9BF00CF7BC4 /* ProxyTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProxyTests.m; sourceTree = ""; }; B5254FF81025F9BF00CF7BC4 /* ProxyTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProxyTests.h; sourceTree = ""; }; B52D4A2D10DA4ED5008E8365 /* PerformanceTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceTests.h; sourceTree = ""; }; @@ -125,6 +166,8 @@ B551DB4610D6938500EC1CBF /* ASIHTTPRequestConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIHTTPRequestConfig.h; sourceTree = ""; }; B551DCAD10D6A11200EC1CBF /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = ""; }; B551DCAE10D6A11200EC1CBF /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = ""; }; + B558B58911C7F637009B4627 /* iPhoneInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = iPhoneInfo.plist; path = "iPhone Sample/iPhoneInfo.plist"; sourceTree = ""; }; + B558B58B11C7F63E009B4627 /* iPadInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = iPadInfo.plist; path = "iPhone Sample/iPadInfo.plist"; sourceTree = ""; }; B55B60450F765A320064029C /* ASIFormDataRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIFormDataRequest.h; sourceTree = ""; }; B55B60460F765A320064029C /* ASIFormDataRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASIFormDataRequest.m; sourceTree = ""; }; B55B60470F765A320064029C /* ASIHTTPRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIHTTPRequest.h; sourceTree = ""; }; @@ -139,7 +182,6 @@ B55B60550F765A3C0064029C /* ASIHTTPRequestTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASIHTTPRequestTests.m; sourceTree = ""; }; B55B60560F765A3C0064029C /* ASINetworkQueueTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASINetworkQueueTests.h; sourceTree = ""; }; B55B60570F765A3C0064029C /* ASINetworkQueueTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASINetworkQueueTests.m; sourceTree = ""; }; - B55B605E0F765A750064029C /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = "iPhone Sample/Info.plist"; sourceTree = ""; }; B55B605F0F765A750064029C /* iPhone_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = iPhone_Prefix.pch; path = "iPhone Sample/iPhone_Prefix.pch"; sourceTree = ""; }; B55B60600F765A750064029C /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = "iPhone Sample/main.m"; sourceTree = ""; }; B55B60670F765A930064029C /* QueueViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = QueueViewController.m; path = "iPhone Sample/QueueViewController.m"; sourceTree = ""; }; @@ -151,10 +193,6 @@ B55B606D0F765A930064029C /* SynchronousViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SynchronousViewController.h; path = "iPhone Sample/SynchronousViewController.h"; sourceTree = ""; }; B55B606E0F765A930064029C /* iPhoneSampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = iPhoneSampleAppDelegate.h; path = "iPhone Sample/iPhoneSampleAppDelegate.h"; sourceTree = ""; }; B55B60730F765A990064029C /* iphone-icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "iphone-icon.png"; path = "iPhone Sample/iphone-icon.png"; sourceTree = ""; }; - B55B60870F765AD90064029C /* Queue.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Queue.xib; path = "iPhone Sample/XIBs/Queue.xib"; sourceTree = ""; }; - B55B60880F765AD90064029C /* UploadProgress.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = UploadProgress.xib; path = "iPhone Sample/XIBs/UploadProgress.xib"; sourceTree = ""; }; - B55B60890F765AD90064029C /* Synchronous.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Synchronous.xib; path = "iPhone Sample/XIBs/Synchronous.xib"; sourceTree = ""; }; - B55B608A0F765AD90064029C /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = MainWindow.xib; path = "iPhone Sample/XIBs/MainWindow.xib"; sourceTree = ""; }; B55B60C70F765BB00064029C /* Tests.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Tests.app; sourceTree = BUILT_PRODUCTS_DIR; }; B55B60CB0F765BB10064029C /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Tests-Info.plist"; path = "iPhone Sample/Tests-Info.plist"; sourceTree = ""; }; B565291E101C8BD7000499CF /* ASITestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASITestCase.h; sourceTree = ""; }; @@ -173,8 +211,12 @@ B576D52211C7CEBC0059B815 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; B576D52411C7CEC00059B815 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; B576D52C11C7CEFA0059B815 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - B576D53411C7CF0A0059B815 /* libz.1.1.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.1.1.3.dylib; path = usr/lib/libz.1.1.3.dylib; sourceTree = SDKROOT; }; B576D53D11C7CF350059B815 /* libz.1.2.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.1.2.3.dylib; path = usr/lib/libz.1.2.3.dylib; sourceTree = SDKROOT; }; + B576D72311C7F34D0059B815 /* ASIHTTPRequest iPad.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ASIHTTPRequest iPad.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + B576D74811C7F3E40059B815 /* iPadSampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iPadSampleAppDelegate.h; sourceTree = ""; }; + B576D74911C7F3E40059B815 /* iPadSampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = iPadSampleAppDelegate.m; sourceTree = ""; }; + B576D76311C7F4D40059B815 /* iPadMainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = iPadMainWindow.xib; path = "iPhone Sample/Resources/iPadMainWindow.xib"; sourceTree = ""; }; + B576D76511C7F4D90059B815 /* iPhoneMainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = iPhoneMainWindow.xib; path = "iPhone Sample/Resources/iPhoneMainWindow.xib"; sourceTree = ""; }; B5873FC110FF28CA001E145F /* ASIS3BucketObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIS3BucketObject.h; sourceTree = ""; }; B5873FC210FF28CA001E145F /* ASIS3BucketObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASIS3BucketObject.m; sourceTree = ""; }; B5873FC510FF28CA001E145F /* ASIS3Request.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIS3Request.h; sourceTree = ""; }; @@ -213,7 +255,7 @@ B576D52311C7CEBC0059B815 /* MobileCoreServices.framework in Frameworks */, B576D52511C7CEC00059B815 /* UIKit.framework in Frameworks */, B576D52D11C7CEFA0059B815 /* Foundation.framework in Frameworks */, - B576D53511C7CF0A0059B815 /* libz.1.1.3.dylib in Frameworks */, + B576D77711C7F5810059B815 /* libz.1.2.3.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -232,6 +274,19 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + B576D71811C7F34D0059B815 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + B576D71911C7F34D0059B815 /* CFNetwork.framework in Frameworks */, + B576D71A11C7F34D0059B815 /* SystemConfiguration.framework in Frameworks */, + B576D71B11C7F34D0059B815 /* MobileCoreServices.framework in Frameworks */, + B576D71C11C7F34D0059B815 /* UIKit.framework in Frameworks */, + B576D71D11C7F34D0059B815 /* Foundation.framework in Frameworks */, + B576D77611C7F5810059B815 /* libz.1.2.3.dylib in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -263,8 +318,9 @@ 19C28FACFE9D520D11CA2CBB /* Products */ = { isa = PBXGroup; children = ( - 1D6058910D05DD3D006BFB54 /* ASIHTTPRequest.app */, + 1D6058910D05DD3D006BFB54 /* ASIHTTPRequest iPhone.app */, B55B60C70F765BB00064029C /* Tests.app */, + B576D72311C7F34D0059B815 /* ASIHTTPRequest iPad.app */, ); name = Products; sourceTree = ""; @@ -290,7 +346,6 @@ B576D52211C7CEBC0059B815 /* MobileCoreServices.framework */, B576D52411C7CEC00059B815 /* UIKit.framework */, B576D52C11C7CEFA0059B815 /* Foundation.framework */, - B576D53411C7CF0A0059B815 /* libz.1.1.3.dylib */, B576D53D11C7CF350059B815 /* libz.1.2.3.dylib */, ); name = iPhone; @@ -299,18 +354,21 @@ 29B97315FDCFA39411CA2CEA /* Other Sources */ = { isa = PBXGroup; children = ( - B51791A11024C3E800583567 /* AuthenticationViewController.h */, - B51791A21024C3E800583567 /* AuthenticationViewController.m */, B55B606D0F765A930064029C /* SynchronousViewController.h */, B55B606A0F765A930064029C /* SynchronousViewController.m */, - B55B60680F765A930064029C /* QueueViewController.h */, - B55B60670F765A930064029C /* QueueViewController.m */, + B51791A11024C3E800583567 /* AuthenticationViewController.h */, + B51791A21024C3E800583567 /* AuthenticationViewController.m */, B55B60690F765A930064029C /* UploadViewController.h */, B55B606C0F765A930064029C /* UploadViewController.m */, + B55B60680F765A930064029C /* QueueViewController.h */, + B55B60670F765A930064029C /* QueueViewController.m */, B55B606E0F765A930064029C /* iPhoneSampleAppDelegate.h */, B55B606B0F765A930064029C /* iPhoneSampleAppDelegate.m */, + B576D74811C7F3E40059B815 /* iPadSampleAppDelegate.h */, + B576D74911C7F3E40059B815 /* iPadSampleAppDelegate.m */, B55B605F0F765A750064029C /* iPhone_Prefix.pch */, B55B60600F765A750064029C /* main.m */, + B52329A911CA3380006C6E5A /* UI helpers */, ); name = "Other Sources"; sourceTree = ""; @@ -318,14 +376,14 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( - B51791941024C3DA00583567 /* Authentication.xib */, - B55B60870F765AD90064029C /* Queue.xib */, - B55B60880F765AD90064029C /* UploadProgress.xib */, - B55B60890F765AD90064029C /* Synchronous.xib */, - B55B608A0F765AD90064029C /* MainWindow.xib */, + B52325AC11CA05A8006C6E5A /* info.png */, + B558B58911C7F637009B4627 /* iPhoneInfo.plist */, + B558B58B11C7F63E009B4627 /* iPadInfo.plist */, + B576D76511C7F4D90059B815 /* iPhoneMainWindow.xib */, + B576D76311C7F4D40059B815 /* iPadMainWindow.xib */, + B523254111CA01F1006C6E5A /* Sample.xib */, B56529A2101C8EDA000499CF /* iphone-tests-icon.png */, B55B60730F765A990064029C /* iphone-icon.png */, - B55B605E0F765A750064029C /* Info.plist */, B55B60CB0F765BB10064029C /* Tests-Info.plist */, ); name = Resources; @@ -338,6 +396,23 @@ name = Frameworks; sourceTree = ""; }; + B52329A911CA3380006C6E5A /* UI helpers */ = { + isa = PBXGroup; + children = ( + B52324F611C9FF9D006C6E5A /* SampleViewController.h */, + B52324F711C9FF9D006C6E5A /* SampleViewController.m */, + B52322C211C94702006C6E5A /* RootViewController.h */, + B52322C311C94702006C6E5A /* RootViewController.m */, + B5231FA811C9148B006C6E5A /* DetailCell.h */, + B5231FA911C9148B006C6E5A /* DetailCell.m */, + B523264511CA0DEC006C6E5A /* ToggleCell.h */, + B523264611CA0DEC006C6E5A /* ToggleCell.m */, + B52325B111CA05B0006C6E5A /* InfoCell.h */, + B52325B211CA05B0006C6E5A /* InfoCell.m */, + ); + name = "UI helpers"; + sourceTree = ""; + }; B551DCAC10D6A11200EC1CBF /* Reachability1.5 */ = { isa = PBXGroup; children = ( @@ -461,7 +536,7 @@ ); name = iPhone; productName = iPhone; - productReference = 1D6058910D05DD3D006BFB54 /* ASIHTTPRequest.app */; + productReference = 1D6058910D05DD3D006BFB54 /* ASIHTTPRequest iPhone.app */; productType = "com.apple.product-type.application"; }; B55B60C60F765BB00064029C /* Tests */ = { @@ -483,6 +558,24 @@ productReference = B55B60C70F765BB00064029C /* Tests.app */; productType = "com.apple.product-type.application"; }; + B576D70211C7F34D0059B815 /* iPad */ = { + isa = PBXNativeTarget; + buildConfigurationList = B576D72011C7F34D0059B815 /* Build configuration list for PBXNativeTarget "iPad" */; + buildPhases = ( + B576D70311C7F34D0059B815 /* Resources */, + B576D70A11C7F34D0059B815 /* Sources */, + B576D71811C7F34D0059B815 /* Frameworks */, + B576D71F11C7F34D0059B815 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = iPad; + productName = iPhone; + productReference = B576D72311C7F34D0059B815 /* ASIHTTPRequest iPad.app */; + productType = "com.apple.product-type.application"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -497,6 +590,7 @@ targets = ( 1D6058900D05DD3D006BFB54 /* iPhone */, B55B60C60F765BB00064029C /* Tests */, + B576D70211C7F34D0059B815 /* iPad */, ); }; /* End PBXProject section */ @@ -507,11 +601,8 @@ buildActionMask = 2147483647; files = ( B55B60740F765A990064029C /* iphone-icon.png in Resources */, - B55B608B0F765AD90064029C /* Queue.xib in Resources */, - B55B608C0F765AD90064029C /* UploadProgress.xib in Resources */, - B55B608D0F765AD90064029C /* Synchronous.xib in Resources */, - B55B608E0F765AD90064029C /* MainWindow.xib in Resources */, - B51791951024C3DA00583567 /* Authentication.xib in Resources */, + B576D76611C7F4D90059B815 /* iPhoneMainWindow.xib in Resources */, + B523254311CA01F1006C6E5A /* Sample.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -523,6 +614,17 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + B576D70311C7F34D0059B815 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B576D70411C7F34D0059B815 /* iphone-icon.png in Resources */, + B558B5EB11C7F9C8009B4627 /* iPadMainWindow.xib in Resources */, + B523254211CA01F1006C6E5A /* Sample.xib in Resources */, + B52325AD11CA05A8006C6E5A /* info.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -552,6 +654,19 @@ shellPath = /bin/sh; shellScript = ./set_version_number.rb; }; + B576D71F11C7F34D0059B815 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = ./set_version_number.rb; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -572,6 +687,10 @@ B522DACF1030B2AB009A2D22 /* ASIInputStream.m in Sources */, B59A87C3103EC6F200300252 /* ASIAuthenticationDialog.m in Sources */, B551DCAF10D6A11200EC1CBF /* Reachability.m in Sources */, + B523200F11C9191C006C6E5A /* DetailCell.m in Sources */, + B52324F911C9FF9D006C6E5A /* SampleViewController.m in Sources */, + B52325B411CA05B0006C6E5A /* InfoCell.m in Sources */, + B523264811CA0DEC006C6E5A /* ToggleCell.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -612,6 +731,32 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + B576D70A11C7F34D0059B815 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B576D70B11C7F34D0059B815 /* ASIFormDataRequest.m in Sources */, + B576D70C11C7F34D0059B815 /* ASIHTTPRequest.m in Sources */, + B576D70D11C7F34D0059B815 /* ASINetworkQueue.m in Sources */, + B576D70E11C7F34D0059B815 /* ASINSStringAdditions.m in Sources */, + B576D70F11C7F34D0059B815 /* main.m in Sources */, + B576D71011C7F34D0059B815 /* QueueViewController.m in Sources */, + B576D71111C7F34D0059B815 /* SynchronousViewController.m in Sources */, + B576D71211C7F34D0059B815 /* iPhoneSampleAppDelegate.m in Sources */, + B576D71311C7F34D0059B815 /* UploadViewController.m in Sources */, + B576D71411C7F34D0059B815 /* AuthenticationViewController.m in Sources */, + B576D71511C7F34D0059B815 /* ASIInputStream.m in Sources */, + B576D71611C7F34D0059B815 /* ASIAuthenticationDialog.m in Sources */, + B576D71711C7F34D0059B815 /* Reachability.m in Sources */, + B576D74A11C7F3E40059B815 /* iPadSampleAppDelegate.m in Sources */, + B5231FAA11C9148B006C6E5A /* DetailCell.m in Sources */, + B52322C411C94702006C6E5A /* RootViewController.m in Sources */, + B52324F811C9FF9D006C6E5A /* SampleViewController.m in Sources */, + B52325B311CA05B0006C6E5A /* InfoCell.m in Sources */, + B523264711CA0DEC006C6E5A /* ToggleCell.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ @@ -627,11 +772,12 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "iPhone Sample/iPhone_Prefix.pch"; GCC_VERSION = com.apple.compilers.llvmgcc42; - INFOPLIST_FILE = "iPhone Sample/Info.plist"; + INFOPLIST_FILE = "iPhone Sample/iPhoneInfo.plist"; IPHONEOS_DEPLOYMENT_TARGET = 2.2.1; - PRODUCT_NAME = ASIHTTPRequest; + PRODUCT_NAME = "ASIHTTPRequest iPhone"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; SDKROOT = iphonesimulator4.0; + TARGETED_DEVICE_FAMILY = 1; }; name = Debug; }; @@ -644,11 +790,12 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "iPhone Sample/iPhone_Prefix.pch"; GCC_VERSION = com.apple.compilers.llvmgcc42; - INFOPLIST_FILE = "iPhone Sample/Info.plist"; + INFOPLIST_FILE = "iPhone Sample/iPhoneInfo.plist"; IPHONEOS_DEPLOYMENT_TARGET = 2.2.1; - PRODUCT_NAME = ASIHTTPRequest; + PRODUCT_NAME = "ASIHTTPRequest iPhone"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; SDKROOT = iphonesimulator4.0; + TARGETED_DEVICE_FAMILY = 1; }; name = Release; }; @@ -719,6 +866,45 @@ }; name = Release; }; + B576D72111C7F34D0059B815 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Ben Copsey (KRBSUQUP72)"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = "compiler-default"; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "iPhone Sample/iPhone_Prefix.pch"; + GCC_VERSION = com.apple.compilers.llvmgcc42; + INFOPLIST_FILE = "iPhone Sample/iPadInfo.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 3.2; + PRODUCT_NAME = "ASIHTTPRequest iPad"; + SDKROOT = iphonesimulator3.2; + TARGETED_DEVICE_FAMILY = 2; + }; + name = Debug; + }; + B576D72211C7F34D0059B815 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Ben Copsey (KRBSUQUP72)"; + COPY_PHASE_STRIP = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "iPhone Sample/iPhone_Prefix.pch"; + GCC_VERSION = com.apple.compilers.llvmgcc42; + INFOPLIST_FILE = "iPhone Sample/iPadInfo.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 3.2; + PRODUCT_NAME = "ASIHTTPRequest iPad"; + SDKROOT = iphonesimulator3.2; + TARGETED_DEVICE_FAMILY = 2; + }; + name = Release; + }; C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -767,6 +953,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + B576D72011C7F34D0059B815 /* Build configuration list for PBXNativeTarget "iPad" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B576D72111C7F34D0059B815 /* Debug */, + B576D72211C7F34D0059B815 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; C01FCF4E08A954540054247B /* Build configuration list for PBXProject "iPhone" */ = { isa = XCConfigurationList; buildConfigurations = (