Say, I want to call a UIActionSheet from a helper class method. I want the helper class (not the object) to be the delegate of this actionsheet.
So I’m passing self to the delegate.
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"MyTitle"
delegate:self
cancelButtonTitle:nil
destructiveButtonTitle:@"Delete"
otherButtonTitles:nil];
My helper class implements the delegate methods as class methods and everything works fine.
But, I get a warning from the compiler that says, Incompatible pointer, sending Class when id is expected. I also tried [self class] and getting the same warning.
How can I avoid this warning?
Just set the delegate to
[self self].