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

Issue when subscribing to NSUserDefaults on iOS #17

Closed
tonyarnold opened this issue Jul 24, 2012 · 4 comments
Closed

Issue when subscribing to NSUserDefaults on iOS #17

tonyarnold opened this issue Jul 24, 2012 · 4 comments
Labels

Comments

@tonyarnold
Copy link
Contributor

NB: This has been discussed to some extent on Twitter, but I think it's worth tracking as an issue.

While it's possible to subscribe to NSUserDefaults values using the following syntax:

[[[NSUserDefaults standardUserDefaults] rac_subscribableForKeyPath:kDWKUserDefaultRequirePasscodeToUnlockKey onObject:self] subscribeNext:^(NSNumber *newValue) {
    ...
}]];

I'm seeing the following crash report from users once the app is compiled for release and distributed:

https://gist.github.com/f7131bf0fa8a18ea884b

Officially, NSUserDefaults has no KVO support on either platform (on OS X and Cocoa proper, you can use the NSUserDefaultsController's values object for KVO support).

I'm hoping this is some kind of simple deallocation issue, but I haven't found a way around this yet (nor a reproducible test case).

@jspahrsummers
Copy link
Member

Are you still seeing crash reports on the latest master? Pull request #29 addressed some issues around deallocation of the KVO trampolines (though it doesn't have anything specific to NSUserDefaults).

@tonyarnold
Copy link
Contributor Author

Thanks @jspahrsummers — I haven't seen the issue after pulling the latest changes.

@jspahrsummers
Copy link
Member

🤘

@jwilling
Copy link
Contributor

Thanks! Fixed it for me as well. ✨

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

No branches or pull requests

3 participants