同一ViewController内如果有两处AlertView要用代理Delegate怎么写法

使用tag值判定到底是哪一个视图.使用tag值判定到底是哪一个视图.使用tag值判定到底是哪一个视图.使用tag值判定到底是哪一个视图.使用tag值判定到底是哪一个视图.使用tag值判定到底是哪一个视图.使用tag值判定到底是哪一个视图.使用tag值判定到底是哪一个视图.使用tag值判定到底是哪一个视图.

在代理中写一个if语句,如下文,如此类推

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {

if(alertView .tag ==1000 )

{
    if(buttonIndex == 1) {
        //代码写在这里
    } else {
        //代码处....
    }

}

if(alertView .tag ==1001 )

{
    if(buttonIndex == 1) {
        //代码写在这里
    } else {
        //代码处....
    }

}


}


posted @ 2014-01-16 22:40  徐坤很无聊  阅读(110)  评论(0编辑  收藏  举报