I have a superclass where I sometimes show an UIAlertView and handles the delegation (clickedButtonAtIndex). When I then have a subclass that also handles the "clickedButtonAtIndex" only the subclass delegation is called.
In both cases the UIAlertView is show like this:
[[[UIAlertView alloc] initWithTitle:@"" message:@"message" delegate:self cancelButtonTitle:@"Close" otherButtonTitles:@"Open", nil]show];
Am I doing something wrong or is it bad design to have the same delegation in both the superclass and subclass. I thought the "delegate:self" separated them.
I can see in the debugger that "self" references to my subclass even though I'm in my superclass so this is probably the problem? Any thoughts?
I was kind of surprised that 'self' references to the subclass when called in a superclass.
Thus I decided to create my own delegation for the UIAlertView to distinguish from the subclass' delegation. This because I dont think: - That the subclasses should know about my private UIAlertView in the superclass and call it. - That the superclass should know about my subclasses delegation.
Feel free to add you thoughts :-)