multiple UIAlertView issue

余生颓废 提交于 2019-12-01 20:00:14

A couple ways.

1)

See how the delegate method is called?

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

From the alertView parameter, you can tell which alert did the calling (if you set cargaImagen and publicaPeticion's alertviews to separate instance variables).

2)

Another (and probably easier) thing you could do is to set a tag property on your alertView.

In your 'cargaImagen' method and right after you create the UIAlert, set the tag to 1 via alert.tag = 1;.

Then, in your alertView:clickedButtonAtIndex: delegate method, when alertView.tag == 1, you'll know it comes from cargaImagen and if it's 2 (or zero), you know it comes from publicaPeticion.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!