In a class method method I declare the following:
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Hello"
message:@"World"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Done", nil];
Now even though the containing method is a class method, the compiler does not complain about the delegate:self
. Now to be the delegate I have to implement the method in UIAlertViewDelegate
protocol.
Does it now matter, if the method is a class method or not, in order to be called when the user interacts with my AlertView?
I am asking this question, because my class does not have any instance variables so I would prefer it to contain class methods only.