-(void) alertView: ( UIAlertView *) alertView
clickedButtonAtIndex: ( NSInteger ) buttonIndex {
// do stuff
// if you want the alert to close, just call [ alertView release ]
}
Can someone explain this method? I’m used to methods that are like “-(IBAction)buttonPress:(id)sender” but this one has three. What do each of those mean?
MethodName : ReturnedType : InputType
is this right?
It’s actually:
Etc, with as many parameters as you want. So that method is called
alertView:clickedButtonAtIndex:— it just has its parameters embedded. It’s the equivalent, in a more “normal” language, ofalertViewClickedButtonAtIndex(UIAlertView *alertView, NSInteger buttonIndex)For a pretty good primer on Obj-C syntax, check out:
http://www.cocoadevcentral.com/d/learn_objectivec/
For info on that particular method, check out this document.