Ask Your Question
0

When my SwiftUI application runs under root privilege, why does NSOpenPanel exhibit .cancel behavior and not display the File Picker?

asked 2023-06-12 02:43:23 +0000

woof gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-06-12 03:01:02 +0000

lalupa gravatar image

This could be due to the fact that NSOpenPanel, like most macOS APIs, is designed to run within the context of a user-level process rather than a system-level process. Running an application under root privilege can cause system-level APIs to behave differently or fail to function altogether.

To resolve this issue, you can try running your application with standard user-level permissions instead of root privilege. Alternatively, you can investigate other ways to interact with the file system that are more suitable for use within a system-level process.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-12 02:43:23 +0000

Seen: 11 times

Last updated: Jun 12 '23