how to disable firstOtherbutton of alertview

I have alert-view that has a tableview as a subview. I want to disable firstOtherbutton after tableview didSelectRowAtIndexPath. I can call alertViewShouldEnableFirstOtherButton but firstotherbutton doesn't change.

- (void)viewDidLoad
{
    self.announcement=[[UIAlertView alloc] initWithTitle:@"Announcement" message:nil delegate:self cancelButtonTitle:nil otherButtonTitles:@"Tamam", nil];

    [announcement setValue:self.tbl.view forKey:@"accessoryView"];
    announcement.delegate =self;
    announcement.tag=100;

    [announcement show];

    [self.tbl.tableView reloadData];

}
-(void)didSelectAnswer
{
   [self performSelector:@selector(alertViewShouldEnableFirstOtherButton:) withObject:announcement afterDelay:0.001];
}

- (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView
{
    if (alertView.tag==100)
    {
        if(!self.tbl.deger)
        {
            return YES;
        }
        return NO;
    }
    return NO;
}

Answers


you have to write your custom alertview to achieve this feature.

Here are some open source implementations of alertview for iOS: https://www.cocoacontrols.com/tags/uialertview


Need Your Help

Solving name-clash in cpp file of a class

c++ namespaces scope name-clash

I would like to call the unscoped function "bar" from "somelib" within the "bar" method of Foo.