隐藏UIAlertView在另一个功能中打开(iPhone SDK)

时间:2010-02-05 05:57:55

标签: iphone sdk uialertview

我正在使用此主题中发布的解决方案:

how to show a alert when user click on use button after shooting a picture using uiimagepicker?

但是,在下一行中出现了“saveImage”未声明的错误。

saveImage = [[UIAlertView alloc] initWithTitle:@“Sa ...

所以我把代码改为:

UIAlertView * saveImage = [[UIAlertView alloc] initWithTitle:@“Sa ...

并且错误消失了,警报显示效果很好。

问题在于,当我尝试在didFinishSavingWithError中忽略下面的警告时,它会从上面给出相同的错误,即“saveImage”未声明(首次在函数中使用)。

我只玩了几天的iPhone开发,所以请原谅我这是一个简单/愚蠢的问题,但是...

如何在didFinishSavingWithError中引用该警报以关闭它?

1 个答案:

答案 0 :(得分:0)

移动UIAlertView * saveImage;到.m文件的顶部(在方法之外),在你想要弹出警报的方法中,回到你的saveImage = [[UIAlertView alloc] initWithTitle:@“Sa ...