views:

12

answers:

1

Is there a way to dismiss the current UIActionSheet when you don't have access to the variable that holds it?

Apparently it makes its own window and makes it the key window, but [[[UIApplication sharedApplication] keyWindow]resignKeyWindow] doesn't seem to be working.

A: 

The key window when a UIActionSheet is displaying is not the action sheet. After you call [actionSheet show] and [actionSheet release] you should then do something like [Singleton setActionSheet:actionSheet], and in the error handler, do something like if([Singleton actionSheet]) { [[Singleton actionSheet] dismissWith...];

David Lawson