VKJSONOperation Class Reference
Inherits from | VKHTTPOperation : VKOperation : NSOperation |
---|---|
Declared in | VKJSONOperation.h VKJSONOperation.m |
– setCompletionBlockWithSuccess:failure:
Sets the completionB
lock property with a block that executes either the specified success or failure block, depending on the state of the request on completion. If
error
returns a value, which can be caused by an unacceptable status code or content type, then failure
is executed. Otherwise, success
is executed.
- (void)setCompletionBlockWithSuccess:(void ( ^ ) ( VKHTTPOperation *operation , id responseObject ))success failure:(void ( ^ ) ( VKHTTPOperation *operation , NSError *error ))failure
Parameters
success |
The block to be executed on the completion of a successful request. This block has no return value and takes two arguments: the receiver operation and the object constructed from the response data of the request. |
---|---|
failure |
The block to be executed on the completion of an unsuccessful request. This block has no return value and takes two arguments: the receiver operation and the error that occurred during the request. |
Discussion
Sets the completionB
lock property with a block that executes either the specified success or failure block, depending on the state of the request on completion. If
error
returns a value, which can be caused by an unacceptable status code or content type, then failure
is executed. Otherwise, success
is executed.
This method should be overridden in subclasses in order to specify the response object passed into the success block.
Declared In
VKHTTPOperation.h