Declared in UIAlertView+AFNetworking.h

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

Showing Alert for Request Operation

Class Methods

showAlertViewForRequestOperationWithErrorOnCompletion:delegate:

+ (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation delegate:(id)delegate
Discussion

Shows an alert view with the error of the specified request operation, if any.

Parameters

operation

The request operation.

delegate

The alert view delegate.

Declared In

UIAlertView+AFNetworking.h

showAlertViewForRequestOperationWithErrorOnCompletion:delegate:cancelButtonTitle:otherButtonTitles:

+ (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ...
Discussion

Shows an alert view with the error of the specified request operation, if any, with a custom cancel button title and other button titles.

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:

+ (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task delegate:(id)delegate
Discussion

Shows an alert view with the error of the specified session task, if any.

Parameters

task

The session task.

delegate

The alert view delegate.

Declared In

UIAlertView+AFNetworking.h

showAlertViewForTaskWithErrorOnCompletion:delegate:cancelButtonTitle:otherButtonTitles:

+ (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ...
Discussion

Shows an alert view with the error of the specified session task, if any, with a custom cancel button title and other button titles.

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