1 #import <Foundation/Foundation.h>
2 #import <UIKit/UIKit.h>
10 @interface AlertSheet : UIApplication
18 - (void) modalView:(UIModalView *)modalView didDismissWithButtonIndex:(NSInteger)buttonIndex;
20 - (void) alertSheet:(UIAlertSheet *)sheet buttonClicked:(int)button;
23 - (void) applicationDidFinishLaunching:(id)unused;
26 @implementation AlertSheet
29 - (void) modalView:(UIModalView *)modalView didDismissWithButtonIndex:(NSInteger)buttonIndex {
33 - (void) alertSheet:(UIAlertSheet *)alertSheet buttonClicked:(int)button {
39 - (void) applicationDidFinishLaunching:(id)unused {
40 NSMutableArray *buttons = [NSMutableArray arrayWithCapacity:(argc_ - 3)];
41 for (size_t i(0); i != argc_ - 3; ++i)
42 [buttons addObject:[NSString stringWithCString:argv_[i + 3]]];
45 UIAlertView *alert = [[[UIAlertView alloc]
46 initWithTitle:[NSString stringWithCString:argv_[1]]
47 message:[NSString stringWithCString:argv_[2]]
55 UIAlertSheet *sheet = [[[UIAlertSheet alloc]
56 initWithTitle:[NSString stringWithCString:argv_[1]]
63 [sheet setBodyText:[NSString stringWithCString:argv_[2]]];
65 [sheet setShowsOverSpringBoardAlerts:YES];
66 [sheet popupAlertAnimated:YES];
72 int main(int argc, char *argv[]) {
77 (char *) "AlertSheet", NULL
80 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
82 UIApplicationMain(1, args, nil, @"AlertSheet");
84 UIApplicationMain(1, args, [AlertSheet class]);