XCode 显示对话框MessageBox ?
Key:
M
#import "111AppDelegate.h"
@implementation QXSAppDelegate
@synthesize m_LB_YesNo;
- (void)dealloc
{
[super dealloc];
}
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application
}
- (IBAction)OnBT_ShowMessage:(id)sender
{
//Secord MessageBox
NSAlert *alert = [[NSAlert alloc] init];
[alert addButtonWithTitle:@"Yes"];
[alert addButtonWithTitle:@"No"];
[alert setMessageText:@"Delete the record?"];
[alert setInformativeText:@"Deleted records cannot be restored."];
[alert setAlertStyle:NSWarningAlertStyle];
int rs = [alert runModal] ;
//NSAlert *alert_msg = [[[NSAlert alloc] init] autorelease];