eXit_door 2013-06-09 02:47 采纳率: 0%
浏览 2268
已采纳

从主视图中删除UIAlertview

应用显示UIAlertview,我使用NSTimer 调用removeFromSuperView删除警报。警报移除后,所有的操作都在当前视图进行了,应该怎么解决?
显示警告的代码:

UIAlertView *alert=[UIAlertView alloc]initWithTitle:@"A" message:@"B" delegate:self cancelButtonTitle:nil otherButtonTitles:nil, nil];
        [alert show];
        [alert release];
[NSTimer scheduledTimerWithTimeInterval:4.0 target:self selector:@selector(removeAlert:) userInfo:nil repeats:NO];

用timer调用方法:

-(void)removeAlert:(id)sender
{
    [alert_View removeFromSuperview];
}
  • 写回答

1条回答

  • ReyZhang 移动开发领域新星创作者 2013-06-09 03:00
    关注

    取消UIAlertView的显示

    [alert dismissWithClickedButtonIndex:0 animated:YES];
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!