UIAlertView遇到的问题

在做项目的时候遇到了一个问题,有关新浪微博的,就是调用新浪微博的一段代码 放在button点击事件里是能看到效果的,但是放到UIAlertView的点击事件里,通过断点测试是能执行到的,但是没有出现效果,用的是这个方法:- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex;

 

突然间感觉调用新浪微博的网页登陆页面有一个webView的弹出界面,可能跟UIAlertView的动画冲突了;于是查了一下UIAlertView的代理方法查了一下

- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex;这个方法是View的隐藏动画结束的时候进行回调;于是用了这个,呵呵,居然能看到效果了,嗯,多想想,多联想 还是有好处的!!!

 

还有几个回调:

- (void)alertViewCancel:(UIAlertView *)alertView;

 //当用户按下HOME键的时候,回调此方法,用户点击Cancel按钮的时候不会回调此方法

- (void)willPresentAlertView:(UIAlertView *)alertView//开始显示View的动画之前进行回调

 

- (void)didPresentAlertView:(UIAlertView *)alertView//显示动画完成之后进行回调 

- (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex//将要开始View隐藏动画的时候进行回调

 

- (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView;//编辑任何默认的字段添加的风格之后调用

原文地址:https://www.cnblogs.com/neworiginou/p/2957307.html