To handle the UIAlertView (or any others class) delegate in class method just have to change the minus - to plus +

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
+ (void)someMethod:(NSString *)title withMessage:(NSString *)message
{
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:title
message:message
delegate:self // same here
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Done", nil];
}

// change to PLUS
+ (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
NSLog(@"Button %d selected", buttonIndex);
}

There is no need to conform to UIAlertViewDelegate protocol, without the statement below will also work.

e.g.

1
@interface ViewController : UIViewController <UIAlertViewDelegate>

Reference: Can I use a class method as a delegate callback