How to disable button in UIActionSheet?

iphone

Solution

Thees buttons are subviews of UIActionSheet and their class is UIThreePartButton

You can get them and do all that you want:

UIActionSheet *a = [[UIActionSheet alloc]initWithTitle:@"" delegate: nil cancelButtonTitle: @"c" destructiveButtonTitle: @"d" otherButtonTitles: @"ot", nil];
    [a showInView: window];

    for(UIView *v in [a subviews])
    {
        if([[v description] hasPrefix: @"<UIThreePartButton"] )
        {
            v.hidden = YES;  //hide
           //((UIButton*)v).enabled = NO;   // disable

        }
    }

Problem

I need to disable the buttons in UIActionSheet. after some operations i need to enable them again. So is there a way to do this. Thanks

Original source

Related problems