macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

NSGetAlertPanel

アラートパネルを返します
id  NSGetAlertPanel ( 
     NSString *   title , 
     NSString *   msg , 
     NSString *   defaultButton , 
     NSString *   alternateButton , 
     NSString *   otherButton, ... );

解説

アラートパネルを返します。

返り値

引数

( NSString * )title
( NSString * )msg
( NSString * )defaultButton
( NSString * )alternateButton
( NSString * )otherButton, ...

フレームワーク

ApplicationKit

クラス

NSGetAlertPanel

Function

使用可能

10.0

参照

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
	id	panel;
	panel = NSGetAlertPanel (NSLocalizedString(@"title", @""),
                        NSLocalizedString(@"msg", @""),
                        NSLocalizedString(@"OK", @""), 
                        NSLocalizedString(@"Cancel", @""),nil);
	[panel orderFront: self];

	//[panel performClose: self];
	//NSReleaseAlertPanel (panel);
}

@end