TOpenDialog/NSOpenPanel在沙盒式Delphi应用程序中不起作用 [英] TOpenDialog/NSOpenPanel not working in a sandboxed Delphi app

查看:123
本文介绍了TOpenDialog/NSOpenPanel在沙盒式Delphi应用程序中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Firemonkey应用程序中的TOpenDialog似乎存在问题,该应用程序已在Mac Appstore中进行了沙箱处理.我使用的是XE3,但它也存在于XE2中. 我实际上在这里找到了一份质量控制报告,但仍未解决:

There seems to be a problem with the TOpenDialog in a Firemonkey application, which is sandboxed for the Mac Appstore. I use XE3, but it is also present in XE2. I actually found a QC report here, but it is still unresolved:

http://qc.embarcadero.com/wc/qcmain.aspx? d = 105344

有人遇到过同样的问题,或者有任何解决办法的想法吗?

Has anyone had the same problem, or any ideas how to work around it?

这很容易检查.只需在窗体上放置一个TOpenDialog并调用Execute方法即可.根据Embarcadero的说明对应用程序进行签名和沙箱处理:

It is very easy to check. Just put a TOpenDialog on a form and call the Execute method. Sign and sandbox the application according to the Embarcadero instructions:

http://docwiki.embarcadero.com/RADStudio/zh-CN/Mac_OS_X_Application_Development

调用Execute时会有延迟,该应用程序冻结了片刻,但未显示任何内容.没有异常或错误消息. 如果未将应用程序沙箱化,则对话框可以正常工作.

When Execute is called there is a delay, the app freezes for a moment, but nothing is shown. There are no exceptions or error messages. If the app is not sandboxed the dialog works properly.

此代码也不起作用,因此问题可能出在TNSOpenPanel中,由TOpenDialog调用,但不幸的是我找不到它.

This code also does not work, so the problem is probably somewhere in the TNSOpenPanel, which is called by the TOpenDialog, but unfortunately I could not find it.

var
  LOpenDir: NSOpenPanel;
begin
  LOpenDir := TNSOpenPanel.Wrap(TNSOpenPanel.OCClass.openPanel);
  LOpenDir.runModal;
  LOpenDir.release;

我阅读了

I read in the Apple docs that with Sandbox the NSOpenPanel is derived from different classes, compared to the one without a sandbox. I guess this is the cause of the problem.

任何想法都将不胜感激.没有打开/保存对话框,我们真的无法发布必须处理文件的应用程序:)

Any ideas would be greatly appreciated. We can't really publish an app that has to work with files without Open/Save dialogs :)

顺便说一句,我尝试了项目选项中权利的几种组合,但它们没有效果.

Btw, I tried several combinations of the Entitlements in Project Options, but they had no effect.

推荐答案

当应用程序在沙箱中时,NSOpenPanel/NSSavePanel应该由称为Powerbox的透明模块管理. AppKit框架的常规面板无效.但是要使Powerbox能够访问文件系统,授权列表应包括

When an application is in sandbox, NSOpenPanel/NSSavePanel should be managed by a transparent module called Powerbox. The normal panels of AppKit framework has no effect. But to enable Powerbox for access to filesystem, the entitlements list should include

com.apple.security.files.user-selected.read-write YES

配置.

这篇关于TOpenDialog/NSOpenPanel在沙盒式Delphi应用程序中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆