1 //2 //VIEWCONTROLLER.M3 //Uiactionsheet Detailed4 //5 //Created by Big Huan on 16/1/25.6 //copyright©2016 year BJSXT. All rights reserved.7 //8 9 #import "ViewController.h"Ten One @interfaceViewcontroller () <UIActionSheetDelegate> A --(Ibaction) Showactionsheet: (ID) sender; - the @end - - @implementationViewcontroller - +- (void) Viewdidload { - [Super Viewdidload]; + A } at -- (void) Actionsheet: (Uiactionsheet *) Actionsheet Clickedbuttonatindex: (Nsinteger) Buttonindex { - - Switch(buttonindex) { - Case 0: -NSLog (@"Determine"); in Break; - Case 1: toNSLog (@"can be"); + Break; - Case 2: theNSLog (@"Cancel"); * Break; $ default:Panax Notoginseng Break; - } the + } A the-(Ibaction) Showactionsheet: (ID) Sender { + -Uiactionsheet * sheet = [[Uiactionsheet alloc] Initwithtitle:@"Topics" Delegate: Self Cancelbuttontitle:@"Cancel"Destructivebuttontitle:@"Determine"Otherbuttontitles:@"can be", nil]; $ $ [sheet ShowInView:self.view]; - -[Self performselector: @selector (dismissactionsheet:) withobject:sheet Afterdelay:5]; the - }Wuyi the- (void) Dismissactionsheet: (Uiactionsheet *) Sheet { - Wu[Sheet Dismisswithclickedbuttonindex:0Animated:yes]; - } About $ - @end
iOS Learning-uiactionsheet Detailed