-
Notifications
You must be signed in to change notification settings - Fork 550
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
Swift project: Cannot remove an observer <CTAssetsPickerController 0x7f94862ad530> #139
Comments
I get the same error when I upgrade my project from xcode6.2 to xcode6.4 (swift1.2).
|
For quick fix, adding try-catch block prevents app to crash. |
@tomoyuki28jp Thanks for your PR but I need time to review and hope to find a root cause of it first. |
@chiunam Thanks for your reply. I haven't created a PR yet. If you need one, please let me know :) |
Hi @DeepDiving2015 and @tomoyuki28jp, may I know if this problem is still exist in Xcode 7 GM? As I have no swift projects on hand, I cannot verify the issue and make subsequence changes. Moving |
@chiunam , I have not upgrade to Xcode 7 GM yet. |
@chiunam I confirm this problem still exists in iOS9 (Xcode7). |
Hi @DeepDiving2015 & @tomoyuki28jp, this issue will be fixed in the next release. |
@chiunam Thanks!! |
hi,
I got this issue when use CTAssetsPickerController in my swift project:
Everything is ok when I open view and pick images. But when I back to the previous view without open CTAssetsPicker view, just crashed with:
*** Terminating app due to uncaught exception 'NSRangeException', reason: 'Cannot remove an observer <CTAssetsPickerController 0x7f94862ad530> for the key path "selectedAssets" from <CTAssetsPickerController 0x7f94862ad530> because it is not registered as an observer.'
please confirm following code:
{
[super viewDidLoad];
[self setupViews];
[self setupEmptyViewController];
[self checkAuthorizationStatus];
[self addKeyValueObserver]; --->here to add
}
{
[self removeKeyValueObserver]; ---> should remove in "viewWillDisapear" instead of here??
}
The text was updated successfully, but these errors were encountered: