0

i am using this example in my code. And it is working just fine for now but when i tap on a button it did not respond or call any method. here is my code:

UICustomActionSheet* customActionSheet = [[UICustomActionSheet alloc] initWithTitle:nil delegate:nil buttonTitles:@[@"Cancel",@"Delete picture", @"Take a new photo", @"Choose from existing"]];
    [customActionSheet setButtonColors:@[[UIColor redColor]]];
    [customActionSheet setBackgroundColor:[UIColor clearColor]];
    [customActionSheet setSubtitle:@"Select your Choice"];
    [customActionSheet setSubtitleColor:[UIColor whiteColor]];
    [customActionSheet showInView:self.view];

and here is method that needs to be called

-(void)customActionSheet:(UICustomActionSheet *)customActionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{
    NSLog(@"%d",buttonIndex);
}
Vix Hunk
  • 303
  • 4
  • 17

1 Answers1

0

The problem is with your delegate. You have set it nil. Set it to self and your problem will be solved.

Vishal Sonawane
  • 2,637
  • 2
  • 16
  • 21