Merge branch 'master' of github.com:AFNetworking/AFNetworking

This commit is contained in:
Mattt Thompson 2012-03-19 14:36:37 -04:00
commit c998a182cd
2 changed files with 22 additions and 10 deletions

View file

@ -48,7 +48,9 @@ NSData * AFJSONEncode(id object, NSError **error) {
NSUInteger serializeOptionFlags = 0;
[invocation setArgument:&serializeOptionFlags atIndex:2]; // arguments 0 and 1 are self and _cmd respectively, automatically set by NSInvocation
[invocation setArgument:error atIndex:3];
if (error != NULL) {
[invocation setArgument:error atIndex:3];
}
[invocation invoke];
[invocation getReturnValue:&data];
@ -99,7 +101,9 @@ NSData * AFJSONEncode(id object, NSError **error) {
[invocation setArgument:&object atIndex:2]; // arguments 0 and 1 are self and _cmd respectively, automatically set by NSInvocation
NSUInteger writeOptions = 0;
[invocation setArgument:&writeOptions atIndex:3];
[invocation setArgument:error atIndex:4];
if (error != NULL) {
[invocation setArgument:error atIndex:4];
}
[invocation invoke];
[invocation getReturnValue:&data];
@ -138,7 +142,9 @@ id AFJSONDecode(NSData *data, NSError **error) {
NSUInteger parseOptionFlags = 0;
[invocation setArgument:&parseOptionFlags atIndex:2]; // arguments 0 and 1 are self and _cmd respectively, automatically set by NSInvocation
[invocation setArgument:error atIndex:3];
if (error != NULL) {
[invocation setArgument:error atIndex:3];
}
[invocation invoke];
[invocation getReturnValue:&JSON];
@ -158,7 +164,9 @@ id AFJSONDecode(NSData *data, NSError **error) {
NSUInteger yajlParserOptions = 0;
[invocation setArgument:&yajlParserOptions atIndex:2]; // arguments 0 and 1 are self and _cmd respectively, automatically set by NSInvocation
[invocation setArgument:error atIndex:3];
if (error != NULL) {
[invocation setArgument:error atIndex:3];
}
[invocation invoke];
[invocation getReturnValue:&JSON];
@ -169,7 +177,9 @@ id AFJSONDecode(NSData *data, NSError **error) {
invocation.selector = _NXJsonParserSelector;
[invocation setArgument:&data atIndex:2]; // arguments 0 and 1 are self and _cmd respectively, automatically set by NSInvocation
[invocation setArgument:error atIndex:3];
if (error != NULL) {
[invocation setArgument:error atIndex:3];
}
[invocation setArgument:&nullOption atIndex:4];
[invocation invoke];
@ -185,7 +195,9 @@ id AFJSONDecode(NSData *data, NSError **error) {
[invocation setArgument:&data atIndex:2]; // arguments 0 and 1 are self and _cmd respectively, automatically set by NSInvocation
NSUInteger readOptions = 0;
[invocation setArgument:&readOptions atIndex:3];
[invocation setArgument:error atIndex:4];
if (error != NULL) {
[invocation setArgument:error atIndex:4];
}
[invocation invoke];
[invocation getReturnValue:&JSON];

View file

@ -174,18 +174,18 @@ extern NSString * const AFNetworkingOperationDidFinishNotification;
///---------------------------------
/**
Sets a callback to be called when an undetermined number of bytes have been downloaded from the server.
Sets a callback to be called when an undetermined number of bytes have been uploaded to the server.
@param block A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the number of bytes written since the last time the upload progress block was called, the total bytes written, and the total bytes expected to be written during the request, as initially determined by the length of the HTTP body. This block may be called multiple times.
@param block A block object to be called when an undetermined number of bytes have been uploaded to the server. This block has no return value and takes three arguments: the number of bytes written since the last time the upload progress block was called, the total bytes written, and the total bytes expected to be written during the request, as initially determined by the length of the HTTP body. This block may be called multiple times.
@see setDownloadProgressBlock
*/
- (void)setUploadProgressBlock:(void (^)(NSInteger bytesWritten, NSInteger totalBytesWritten, NSInteger totalBytesExpectedToWrite))block;
/**
Sets a callback to be called when an undetermined number of bytes have been uploaded to the server.
Sets a callback to be called when an undetermined number of bytes have been downloaded from the server.
@param block A block object to be called when an undetermined number of bytes have been uploaded to the server. This block has no return value and takes three arguments: the number of bytes read since the last time the upload progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times.
@param block A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times.
@see setUploadProgressBlock
*/