标签:
1 #import "AppDelegate.h"
2
3 @interface AppDelegate ()<UIActionSheetDelegate>
4
5 @end
6
7 @implementation AppDelegate
8
9
10 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
11 self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
12 // Override point for customization after application launch.
13 self.window.backgroundColor = [UIColor whiteColor];
14
15 UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"File Action" delegate:self cancelButtonTitle:@"cancel" destructiveButtonTitle:@"load" otherButtonTitles:@"save",@"Delete", nil];
16 [sheet showInView:self.window];
17
18
19 [self.window makeKeyAndVisible];
20 return YES;
21 }
22
23 - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
24 {
25 NSLog(@"Button %ld is pressed...",buttonIndex);
26 }
27
28 @end
标签:
原文地址:http://www.cnblogs.com/lantu1989/p/4611960.html