Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetDefaultApplicationAtURLToOpenContentTypeCompletionHandler error #220

Open
taramk opened this issue Sep 27, 2023 · 0 comments
Open

SetDefaultApplicationAtURLToOpenContentTypeCompletionHandler error #220

taramk opened this issue Sep 27, 2023 · 0 comments

Comments

@taramk
Copy link
Collaborator

taramk commented Sep 27, 2023

error reported:

I'm noticing that this particular method:

  • (void)setDefaultApplicationAtURL:(NSURL *)applicationURL toOpenContentTypeOfFileAtURL:(NSURL *)url completionHandler:(void (^_Nullable)(NSError *_Nullable error))completionHandler API_AVAILABLE(macos(12.0));

has a nullable pointer to error for the error argument in the completion handler.

But in macdriver the callback accepts a non-pointer.

i've switched to a more reliable approach of using SetDefaultApplicationAtURLToOpenContentTypeCompletionHandler which lets me just look up the uniform type based on the extension rather than dealing with any files, and I get this error:
Error Domain=NSCocoaErrorDomain Code=256 "The file couldn’t be opened." UserInfo={NSUnderlyingError=0x600000c01050 {Error Domain=NSOSStatusErrorDomain Code=-50 "paramErr: error in user parameter list"}}

Fix according to @progrium :

we need to override that method with one that takes a callback that is nullable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant