Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Sbrocket

macrumors 65816
Jun 3, 2007
1,250
0
/dev/null
I'm not sure if this is correct, but you might be able to close it by calling this:

-[UIModalView dismissWithClickedButtonIndex:animated:]

Take a look at the docs on that (UIModalView is the superclass of UIAlertView) and see if it works.
 

ace2600

macrumors member
Original poster
Mar 16, 2008
71
0
Austin, Texas
Thanks! That worked.

I had read the UIModalView methods, but didn't think about calling this manually (as opposed to being triggered by the cancel button).

If anyone is interested in the code:
Code:
//Create UIAlertView alert
alert = [[UIAlertView alloc] initWithTitle:@"Alert Title" message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles: nil];

//In another function
[alert dismissWithClickedButtonIndex:0 animated:TRUE];
 

Sbrocket

macrumors 65816
Jun 3, 2007
1,250
0
/dev/null
Yeah, I thought at first from reading the description (that could probably be changed a bit) that it sounded like it should be a delegate method or something, but it wasn't marked as such so might as well give it a try. Its probably set as the action for a UIControlEventTouchUpInside on the buttons when the view is created, but I can't see any side effects to calling it directly.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.