How do you apply the 'tag' property successfully (specifically for UIAlertViews + UIAlertSheets). Here is an example of code that is ineffective right now (In NSLogs, they are all loading the same delegate). I have looked through other threads but after applying those tips, I still am having no success:
[Please help ASAP] thanks
Code:
- (IBAction)action:(id)sender
{
UIAlertView *analert = [[UIAlertView alloc]
initWithTitle:@"title" message:@"message"
delegate:self
cancelButtonTitle:@"cancel"
otherButtonTitles:nil];
[analert addButtonWithTitle:@"uno"];
[analert addButtonWithTitle:@"dos"];
[analert addButtonWithTitle:@"tres"];
analert.tag = 2;
[analert show];
[analert release];
}
- (void)buttons:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (alertView.tag == 2) {
switch(buttonIndex)
//case actions
[Please help ASAP] thanks