
我正在使用NSOpenPanel,它允许选择文件,代码如下所示,
- (IBAction)sendfilebuttonAction:(ID)sender{ NSOpenPanel* openDlg = [NSOpenPanel openPanel]; // Enable the selection of files in the dialog. [openDlg setCanChoosefiles:YES]; // Enable the selection of directorIEs in the dialog. [openDlg setCanChooseDirectorIEs:YES]; // display the dialog. If the OK button was pressed,// process the files. if ( [openDlg runModalForDirectory:nil file:nil] == NSOKbutton ) { // Get an array containing the full filenames of all // files and directorIEs selected. NSArray* files = [openDlg filenames]; // Loop through all the files and process them. for( int i = 0; i < [files count]; i++ ) { Nsstring* filename = [files objectAtIndex:i]; [self log:filename]; // Do something with the filename. } }} 一切都很完美,但我只面对一个问题,打开文件时会显示“打开”和“取消”按钮,
有没有办法将打开的按钮重命名为“选择”按钮,或者我需要使用其他可可资源。
[openDlg setPrompt:@"Select"];总结
以上是内存溢出为你收集整理的可可 – 如何在NSOpenPanel中将“打开”更改为“选择”?全部内容,希望文章能够帮你解决可可 – 如何在NSOpenPanel中将“打开”更改为“选择”?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)