Hi!
I'd like to create a subclass of UIAlertView to implement my own defaut behaviors when users click on the dialog's buttons.
It would be awesome if someone would guide me through it or just point me to some guide about subclassing?
Thanks!
Hi!
I'd like to create a subclass of UIAlertView to implement my own defaut behaviors when users click on the dialog's buttons.
It would be awesome if someone would guide me through it or just point me to some guide about subclassing?
Thanks!
There is not much to say about subclassing in Objective C.
The standard syntax looks like this.
@interface NSObjectSubClassedObject : NSObject {
}
Two things to mention: Multi-Inheritance is not supported and there's another method to "subclass" certain objects called Categories.
You most likely don't want to subclass UIAlertView. Rather you want to implement the UIAlertViewDelegate protocol on your view controller. This will allow you to customize what happens when a user clicks a button on the alert view.
Some some examples, check out any of the sample projects listed under "Related sample code" at the protocol documentation that I've linked to above.