h.
#import <UIKit/UIKit.h>
@interface actionsheetViewController : UIViewController<UIActionSheetDelegate> {
IBOutlet UILabel*myLabel;
}
-(IBAction) tapBtn;
@end
m.
#import "actionsheetViewController.h"
@implementation actionsheetViewController
-(IBAction)tapBtn {
UIActionSheet *actionSheet =[[UIActionSheet alloc]
initWithTitle:@"title" delegate:self cancelButtonTitle:@"キャンセル" destructiveButtonTitle:@"注意"
otherButtonTitles:@"処理1" , @"処理2" ,nil];
[actionSheet showInView:self.view];
[actionSheet release];
}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
myLabel.text =[NSString stringWithFormat:@"ボタンNo = %d" , buttonIndex];
}
#import <UIKit/UIKit.h>
@interface actionsheetViewController : UIViewController<UIActionSheetDelegate> {
IBOutlet UILabel*myLabel;
}
-(IBAction) tapBtn;
@end
m.
#import "actionsheetViewController.h"
@implementation actionsheetViewController
-(IBAction)tapBtn {
UIActionSheet *actionSheet =[[UIActionSheet alloc]
initWithTitle:@"title" delegate:self cancelButtonTitle:@"キャンセル" destructiveButtonTitle:@"注意"
otherButtonTitles:@"処理1" , @"処理2" ,nil];
[actionSheet showInView:self.view];
[actionSheet release];
}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
myLabel.text =[NSString stringWithFormat:@"ボタンNo = %d" , buttonIndex];
}