UIAlertView(AFNetworking) Category Reference
Declared in | UIAlertView+AFNetworking.h UIAlertView+AFNetworking.m |
Overview
This category adds methods to the UIKit framework’s UIAlertView
class. The methods in this category provide support for automatically showing an alert if a session task or request operation finishes with an error. Alert title and message are filled from the corresponding localizedDescription
& localizedRecoverySuggestion
or localizedFailureReason
of the error.
Tasks
Showing Alert for Session Task
-
+ showAlertViewForTaskWithErrorOnCompletion:delegate:
-
+ showAlertViewForTaskWithErrorOnCompletion:delegate:cancelButtonTitle:otherButtonTitles:
Showing Alert for Request Operation
Class Methods
showAlertViewForRequestOperationWithErrorOnCompletion:delegate:
Shows an alert view with the error of the specified request operation, if any.
+ (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation delegate:(id)delegate
Parameters
- operation
The request operation.
- delegate
The alert view delegate.
Declared In
UIAlertView+AFNetworking.h
showAlertViewForRequestOperationWithErrorOnCompletion:delegate:cancelButtonTitle:otherButtonTitles:
Shows an alert view with the error of the specified request operation, if any, with a custom cancel button title and other button titles.
+ (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ...
Parameters
- operation
The request operation.
- delegate
The alert view delegate.
- cancelButtonTitle
The title of the cancel button or nil if there is no cancel button. Using this argument is equivalent to setting the cancel button index to the value returned by invoking addButtonWithTitle: specifying this title.
- otherButtonTitles
The title of another button. Using this argument is equivalent to invoking addButtonWithTitle: with this title to add more buttons. Too many buttons can cause the alert view to scroll. For guidelines on the best ways to use an alert in an app, see “Temporary Views”. Titles of additional buttons to add to the receiver, terminated with
nil
.
Declared In
UIAlertView+AFNetworking.h
showAlertViewForTaskWithErrorOnCompletion:delegate:
Shows an alert view with the error of the specified session task, if any.
+ (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task delegate:(id)delegate
Parameters
- task
The session task.
- delegate
The alert view delegate.
Declared In
UIAlertView+AFNetworking.h
showAlertViewForTaskWithErrorOnCompletion:delegate:cancelButtonTitle:otherButtonTitles:
Shows an alert view with the error of the specified session task, if any, with a custom cancel button title and other button titles.
+ (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ...
Parameters
- task
The session task.
- delegate
The alert view delegate.
- cancelButtonTitle
The title of the cancel button or nil if there is no cancel button. Using this argument is equivalent to setting the cancel button index to the value returned by invoking addButtonWithTitle: specifying this title.
- otherButtonTitles
The title of another button. Using this argument is equivalent to invoking addButtonWithTitle: with this title to add more buttons. Too many buttons can cause the alert view to scroll. For guidelines on the best ways to use an alert in an app, see “Temporary Views”. Titles of additional buttons to add to the receiver, terminated with
nil
.
Declared In
UIAlertView+AFNetworking.h