1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| #import <Foundation/Foundation.h>
#import "Employee.h"
#import "ConnectionDelegate.h"
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
ConnectionDelegate *connectionDelegate = [[ConnectionDelegate alloc] init];
NSURL *baseURL = [[NSURL URLWithString:@"http://store.apple.com"] retain];
NSURLRequest *request =
[NSURLRequest requestWithURL:baseURL
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:60.0];
NSURLConnection *connection = [NSURLConnection connectionWithRequest:request
delegate:connectionDelegate];
if (connection) {
[connectionDelegate setReceivedData:[[NSMutableData data] retain]];
}
[pool drain];
return 0;
} |