Home > Object-C | iPhone | iPhone SDK 3 > iPhoneアプリ アラートボックスを表示する。

iPhoneアプリ アラートボックスを表示する。

安いインクをお探しですか?

iPhone AlertBox

AlertBoxAppDelegate.h

#import <UIKit/UIKit.h>

@class AlertBoxViewController;
@interface AlertBoxAppDelegate : NSObject <UIApplicationDelegate> {
    UIWindow *window;
	AlertBoxViewController *viewController;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet AlertBoxViewController *viewController;

@end

AlertBoxViewController.h

#import <UIKit/UIKit.h>

@interface AlertBoxViewController : UIViewController {
}
- (IBAction) displayView:(id) sender;

@end

AlertBoxViewController.m

//アラートボックスを表示するdisplayViewメソッド
-(IBAction) displayView:(id) sender{

    UIAlertView *alert = [[UIAlertView alloc]
						  initWithTitle:@"アラート画面"
						  message:@"ボタンを押しました"
						  delegate:self
						  cancelButtonTitle:@"閉じる"
						  otherButtonTitles:nil];
    [alert show];
    [alert release];
}

後は、InterfaceBuilderで、Alertを表示させるトリガーのボタンと、
File’s OwnerをCtrl+ドラッグで結んで、「displayView」を結びます。

Comments:1

Truden 10-01-18 (月) 20:00

Interesting, I`ll quote it on my site later.
[url=http://www.vapority.com/]Truden[/url]

Comment Form
Remember personal info

Trackbacks:0

Trackback URL for this entry
http://splitchin.com/tech/2010/01/17/iphone%e3%82%a2%e3%83%97%e3%83%aa%e3%80%80%e3%82%a2%e3%83%a9%e3%83%bc%e3%83%88%e3%83%9c%e3%83%83%e3%82%af%e3%82%b9%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b%e3%80%82/trackback/
Listed below are links to weblogs that reference
iPhoneアプリ アラートボックスを表示する。 from あらびき林檎。

Home > Object-C | iPhone | iPhone SDK 3 > iPhoneアプリ アラートボックスを表示する。

カテゴリー
RSS あらびき林檎
スポンサー

Return to page top