Home > DeveloperSection > Forums > Alert View button index delegate method not called
zack mathews
zack mathews

Total Post:23

Posted on    December-04-2015 7:31 AM

 iPhone iPhone  Ios  Objective C 

 1 Reply(s)
 503  View(s)
Rate this:

Am new to AlertViews with actions. Have set mine up as in the examples I found here including setting the delegate method in my .h, but when I debug find that it is not reaching my clickedButtonAtIndex method.

What gets wrong in my code, please help me.

Tarun Kumar

Total Post:214

Posted on    December-07-2015 11:17 PM

I think your problem will be in the alert view delegate, set your delegate to self.
Like this:

UIAlertView *alertObj = [[UIAlertView alloc]

initWithTitle : @"Write your title here"
                               message : @"Write your message here"
                              delegate : self // set self here
                     cancelButtonTitle : @"Cancel Button Clicked"
                     otherButtonTitles : nil];

Modified On Dec-07-2015 11:20:56 PM

Don't want to miss updates? Please click the below button!

Follow MindStick