-
Notifications
You must be signed in to change notification settings - Fork 283
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
Various issues with Key-Value Observing implementation #324
Comments
I think the determination of how to proceed with this should be made by @rfm. Although I am okay with the integration of MIT code, we would need to note that in our documentation. I think it's important for us to be as compatible as possible with the Apple implementation. Whether that means using the code you mention or fixing our own implementation. |
Hi Frederik, I think the most important part that you may contribute are test cases. Just open up a merge request with plenty of not supported or failing test cases. That way we see which funtionality is missing or wrong. Of course addressing performance issues is a bit harder but these are a second step. |
100% agree. |
Thanks for the offer. It sounds like it coudl be very useful, As Fred says, what we most want are testcases, because I have absolutely no code using KVO (and I think that's similar for most other developers), so we need help understanding how it's intended to behave. Greg has provided code to expose contexts (the remove method), which looks reasonable to me, but without testcases we don't know if it's really correct. From what you say, that leaves support for dependent keys missing, but I don't really know what's needed for that (what the system is supposed to do), so help there would be very useful. |
The KVO implementation in GNUstep is incorrect and incomplete in various regards, e.g.:
context
pointer is used internally by GNUstep and can not be used by the user as intended by the API+keyPathsForValuesAffectingX:
methods)We’ve been using the KVO implementation from WinObjC (1, 2, 3), which we worked on with Microsoft on stabilization and performance optimizations, and which we integrated in GNUstep. Since we’re using KVO extensively in our app I’m confident to say that the result (including some additional fixes not part of WinObjC) is an almost perfect re-implementation of KVO, including support for dependent key paths with transitive dependencies which is very complex and hard to get right. Performance is still slightly lower than Apple’s implementation but fairly good after spending considerable amount of time on optimizations.
I’d be happy to open a pull request with our integration (WinObjC is MIT-licenced), however the implementation is in Objective-C++ using C++ templates which are not easy to adapt to C.
I wanted to leave this here to at least document these issues. Please let me know if I should still open this PR and either (a) it might get accepted with Objective-C++ or (b) someone else would be willing to migrate the code to plain Objective-C.
The text was updated successfully, but these errors were encountered: