Question

I am using the solution posted in this thread:

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

However, that gave an error on the following line that "saveImage" was undeclared.

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

So I changed the code to read:

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

and the error went away, and the alert displays great.

The problem is that when I try to dismiss the alert below in didFinishSavingWithError it gives the same error from above that "saveImage" is undeclared (first use in function).

I've only been playing around with iPhone development for a few days, so please forgive me if this a a simple/stupid question, but ...

How do I reference that alert inside of didFinishSavingWithError to close it?

Was it helpful?

Solution

Move the UIAlertView *saveImage; to the top of the .m file (outside the method) and in your method where you want to pop the Alert go back to your saveImage = [[UIAlertView alloc] initWithTitle:@"Sa...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top