Xcode Cocoa程序MessageBox 弹框
来源:互联网 发布:mysql 最多从库 编辑:程序博客网 时间:2024/06/15 23:12
相信很多Windows程序员都习惯MessageBox弹框提示, 在MacOS下也有类似MessageBox这种弹框提示方法
第一种方法
//其他的各种弹框类型 NSAlert *alert = [[NSAlert alloc] init]; //[alert addButtonWithTitle:@"OK"]; //[alert addButtonWithTitle:@"Cancel"]; [alert setMessageText:@"test?"]; //[alert setInformativeText:@"Deleted records cannot be restored."]; //[alert setAlertStyle:NSWarningAlertStyle]; // [alert setHelpAnchor:@"ddd"]; // [alert setInformativeText:@"asdfa"]; // [alert setMessageText:strMsg]; /* [alert beginSheetModalForWindow:_window modalDelegate:self didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) contextInfo:nil]; */ [alert runModal];
第二种方法
CFOptionFlags result; NSString *strMsg = [NSString stringWithFormat:@"%i", 234]; CFStringRef* msg_ref; CFUserNotificationDisplayAlert(0, kCFUserNotificationNoDefaultButtonFlag, NULL, NULL, NULL, CFSTR("Title"), CFSTR("Message"), NULL, NULL, NULL, &result);
0 0
- Xcode Cocoa程序MessageBox 弹框
- 用第三方dylib,在XCode下编译Cocoa程序
- MAC下用XCode开发Cocoa程序简单教程
- 用第三方dylib,在XCode下编译Cocoa程序
- Xcode第二个Cocoa程序——交换图片
- xcode iphone messagebox
- XCode、Objective-C、Cocoa !!!
- Cocoa 中类似MessageBox的方法
- Cocoa程序启动过程
- cocoa 程序运行过程
- XCode 显示对话框MessageBox about NSAlert
- [Cocoa] Cocoa Tutorial 2: HelloWin without XCode and Interface Builder
- NeXT,NEXTSTEP,OPENSTEP,Cocoa,Cocoa Touch,GNUstep,xcode
- HOOK所有程序的MessageBox
- C# 控制台程序显示MessageBox
- C# 控制台程序显示MessageBox
- php小程序--记事本--messagebox
- HOOK所有程序的MessageBox
- poll和select的使用和差异
- OpenWRT 开发小记
- SDL中的互斥量和条件变量
- Error using fmincon (line 816), Hessian option set to 'on' but no Hessian function provided in optio
- 指针自加问题
- Xcode Cocoa程序MessageBox 弹框
- 一些学习前端的网站(html&css&javascript等)持续更新。。。
- cocos2dx-3.3 使用编辑框(EditBox)
- 安卓广播BroadcastReceiver
- Multiply Strings
- UIWebView和Js交互
- FusionCharts的使用方法
- NASM Intro - Compile and Link
- iOS开发网络数据之AFNetworking使用