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

Bring back a smart pointer for reference counting #24

Closed
SSheldon opened this issue May 10, 2015 · 2 comments
Closed

Bring back a smart pointer for reference counting #24

SSheldon opened this issue May 10, 2015 · 2 comments

Comments

@SSheldon
Copy link
Owner

The Id struct was moved into an external crate in 81a972f, but it seems fundamental enough to exist in this crate in some form.

It was removed because, although its design satisfied the requirements of my foundation wrapper, it isn't compatible with the cocoa crate. The cocoa crate is a lower-level wrapper that operates with raw pointers, so it expects objects as *mut Object where the Id struct could be dereferenced to &Object.

The smart pointer should return with a design that will also be usable by cocoa and other libraries without requiring that users put a lot of effort into determining a safe interface for them.

@SSheldon
Copy link
Owner Author

I think the best bet here is to expose a lower-level representation in objc that higher-level representations can be built atop. That way cocoa can keep working directly with object pointers while objc_id can offer a fully safe interface.

@madsmtm
Copy link

madsmtm commented Jun 3, 2021

The cocoa crate doesn't handle reference counting, so I think there would be merit in considering moving the objc_id functionality back into this crate - but I've opened #101 for that.

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

2 participants