我有一个以tableview作为子视图的alert-view。我想在tableview firstOtherbutton
之后停用didSelectRowAtIndexPath
。我可以致电alertViewShouldEnableFirstOtherButton
,但firstotherbutton
不会改变。
- (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;
}
答案 0 :(得分:0)
您必须编写自定义警报视图才能实现此功能。
以下是针对iOS的alertview的一些开源实现: https://www.cocoacontrols.com/tags/uialertview