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

Request for NSSavePanel::allowedContentTypes #657

Closed
Berrysoft opened this issue Oct 1, 2024 · 3 comments
Closed

Request for NSSavePanel::allowedContentTypes #657

Berrysoft opened this issue Oct 1, 2024 · 3 comments
Labels
A-framework Affects the framework crates and the translator for them bug Something isn't working

Comments

@Berrysoft
Copy link
Contributor

NSSavePanel::allowedFileTypes is deprecated and removed from the Apple documents.

@madsmtm madsmtm added question Further information is requested A-framework Affects the framework crates and the translator for them labels Oct 1, 2024
@madsmtm
Copy link
Owner

madsmtm commented Oct 1, 2024

I'm not sure what you mean? NSSavePanel::allowedFileTypes is available in objc2-app-kit, and also available in Apple's docs?

@Berrysoft
Copy link
Contributor Author

It is hidden in the content table: https://developer.apple.com/documentation/appkit/nssavepanel?language=objc

And I would like to solve the deprecation warnings instead of just marking them as allow

@madsmtm madsmtm closed this as completed in c85f91e Oct 1, 2024
@madsmtm
Copy link
Owner

madsmtm commented Oct 1, 2024

I think I get it now, I was confused at first because I read allowedFileTypes and allowedContentTypes as the same thing, but your issue is of course that objc2-app-kit does not expose the recommended alternative.

I have fixed this in c85f91e, in the meantime you can do something like:

use objc2_app_kit::NSSavePanel;
use objc2_uniform_type_identifiers::UTType;

pub fn allowedContentTypes(panel: &NSSavePanel) -> Retained<NSArray<UTType>> {
    unsafe { msg_send_id![panel, allowedContentTypes] }
}

@madsmtm madsmtm added bug Something isn't working and removed question Further information is requested labels Oct 1, 2024
@madsmtm madsmtm added this to the objc2 v0.6 milestone Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-framework Affects the framework crates and the translator for them bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants