Wednesday, June 5, 2013

disable UIAlert View Button-- iOS


//##########################################################
#pragma mark - Action Sheet Delegate
//########################################################## //vijay
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet
{
    for (UIView* view in [actionSheet subviews])
    {
      
        NSLog(@"[[view class] description]..%@",[[view class] description]);

        if ([[[view class] description] isEqualToString:@"UIAlertButton"])
        {
            if ([view respondsToSelector:@selector(title)])
            {
                NSString* title = [view performSelector:@selector(title)];
                if ([title isEqualToString:@"UIAlert View Title"] && [view respondsToSelector:@selector(setEnabled:)])
                {
                    if (hideTranscription) {
                         [view performSelector:@selector(setEnabled:) withObject:NO];
                    }
                   
                }      
            }       
        }  
    }
}