1 #import <Foundation/Foundation.h>
2 #import <UIKit/UIKit.h>
10 @interface AlertSheet : UIApplication {
13 - (void) alertSheet:(UIAlertSheet *)sheet buttonClicked:(int)button;
14 - (void) applicationDidFinishLaunching:(id)unused;
17 @implementation AlertSheet
19 - (void) alertSheet:(UIAlertSheet *)sheet buttonClicked:(int)button {
24 - (void) applicationDidFinishLaunching:(id)unused {
25 NSMutableArray *buttons = [NSMutableArray arrayWithCapacity:(argc_ - 3)];
26 for (size_t i(0); i != argc_ - 3; ++i)
27 [buttons addObject:[NSString stringWithCString:argv_[i + 3]]];
29 UIAlertSheet *sheet = [[[UIAlertSheet alloc]
30 initWithTitle:[NSString stringWithCString:argv_[1]]
37 [sheet setBodyText:[NSString stringWithCString:argv_[2]]];
39 [sheet setShowsOverSpringBoardAlerts:YES];
40 [sheet popupAlertAnimated:YES];
45 int main(int argc, char *argv[]) {
50 (char *) "AlertSheet", NULL
53 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
54 UIApplicationMain(1, args, [AlertSheet class]);