I got an app with an UIAlertView.
When this alertView close, i wanna implement some code. But i cant do it.
I connect UIAlertViewDelegate and the write this methods:
-(void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex{
NSLog(@"%i",buttonIndex);
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
NSLog(@"%i",buttonIndex);
}
-(void)alertViewCancel:(UIAlertView *)alertView{
NSLog(@"cancel alert view");
}
But nothing typed in output. Why? Thnx.
UPD connection to UIAlertViewDelegate:
@interface PlaceListViewController : UIViewController <UITableViewDataSource, UITableViewDelegate, CLLocationManagerDelegate, UIAlertViewDelegate>
{
CLLocationManager *locationManager;
}
Those method calls look fine, so it’s probably a problem with how you set up your delegate. Are you setting
delegatetoselfwhen you create the alert view?