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

Completely refactored NSObject+RACKVOWrapper #29

Merged
merged 7 commits into from Aug 8, 2012
Merged

Conversation

jspahrsummers
Copy link
Member

Includes:

  • Better vocabulary – "targets" become "observers," and observed objects are now referred to as "targets"
  • Less code duplication
  • Thread safety
  • Some unit tests (primarily to verify the memory management)

This refactoring clears up (IMO) the vocabulary of the implementation. What were known as "targets" are now "observers," and observed objects are now known as "targets." (The switch is undoubtably confusing, but it should be clearer going forward.)

This also removes the unnecessary distinction between target/observer trampolines, and improves thread safety.
This way, tests can use __weak references to verify memory management.
dannygreg pushed a commit that referenced this pull request Aug 8, 2012
Completely refactored NSObject+RACKVOWrapper
@dannygreg dannygreg merged commit d7eb970 into master Aug 8, 2012
[self rac_customObservableDealloc];
[trampolines makeObjectsPerformSelector:@selector(stopObserving)];

[self performSelector:@selector(rac_customDealloc)];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wat? Why not just call it directly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, shit. This was left over from trying a bunch of different things when all of this wasn't working.

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

Successfully merging this pull request may close these issues.

None yet

3 participants