How to create that black/gray modal popup kind of view that many apps use, when some long pending operation is in progress?
Like when using location based services, load
This is actually the undocumented (in 2.2.1 anyway) UIProgressHUD. Create one like this:
In your .h:
@interface UIProgressHUD : NSObject
- (UIProgressHUD *) initWithWindow: (UIView*)aWindow;
- (void) show: (BOOL)aShow;
- (void) setText: (NSString*)aText;
@end
In your .m:
- (void) killHUD: (id)aHUD
{
[aHUD show:NO];
[aHUD release];
}
- (void) presentSheet
{
id HUD = [[UIProgressHUD alloc] initWithWindow:[contentView superview]];
[HUD setText:@"Doing something slow. Please wait."];
[HUD show:YES];
[self performSelector:@selector(killHUD:) withObject:HUD afterDelay:5.0];
}