Update README.md
* Remove references to autorelease. * Replace progress NSInteger with NSUInteger.
This commit is contained in:
parent
1637ee2e67
commit
aaf3da98e1
1 changed files with 3 additions and 3 deletions
|
|
@ -122,8 +122,8 @@ NSMutableURLRequest *request = [httpClient multipartFormRequestWithMethod:@"POST
|
||||||
[formData appendPartWithFileData:imageData name:@"avatar" fileName:@"avatar.jpg" mimeType:@"image/jpeg"];
|
[formData appendPartWithFileData:imageData name:@"avatar" fileName:@"avatar.jpg" mimeType:@"image/jpeg"];
|
||||||
}];
|
}];
|
||||||
|
|
||||||
AFHTTPRequestOperation *operation = [[[AFHTTPRequestOperation alloc] initWithRequest:request] autorelease];
|
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
|
||||||
[operation setUploadProgressBlock:^(NSInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) {
|
[operation setUploadProgressBlock:^(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) {
|
||||||
NSLog(@"Sent %lld of %lld bytes", totalBytesWritten, totalBytesExpectedToWrite);
|
NSLog(@"Sent %lld of %lld bytes", totalBytesWritten, totalBytesExpectedToWrite);
|
||||||
}];
|
}];
|
||||||
[operation start];
|
[operation start];
|
||||||
|
|
@ -134,7 +134,7 @@ AFHTTPRequestOperation *operation = [[[AFHTTPRequestOperation alloc] initWithReq
|
||||||
``` objective-c
|
``` objective-c
|
||||||
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://localhost:8080/encode"]];
|
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://localhost:8080/encode"]];
|
||||||
|
|
||||||
AFHTTPRequestOperation *operation = [[[AFHTTPRequestOperation alloc] initWithRequest:request] autorelease];
|
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
|
||||||
operation.inputStream = [NSInputStream inputStreamWithFileAtPath:[[NSBundle mainBundle] pathForResource:@"large-image" ofType:@"tiff"]];
|
operation.inputStream = [NSInputStream inputStreamWithFileAtPath:[[NSBundle mainBundle] pathForResource:@"large-image" ofType:@"tiff"]];
|
||||||
operation.outputStream = [NSOutputStream outputStreamToMemory];
|
operation.outputStream = [NSOutputStream outputStreamToMemory];
|
||||||
[operation start];
|
[operation start];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue