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

Crash unrecognized selector sent to instance #28

Closed
Tayphoon opened this issue Aug 17, 2019 · 8 comments
Closed

Crash unrecognized selector sent to instance #28

Tayphoon opened this issue Aug 17, 2019 · 8 comments

Comments

@Tayphoon
Copy link

Tayphoon commented Aug 17, 2019

It was easy recreate this crash if you have objective-c app with code like this in app delegate

@implementation AppDelegate

+ (instancetype)sharedDelegate {
    return (AppDelegate*)[UIApplication sharedApplication].delegate;
}

Now any calls sharedDelegate in objective-c will return RxApplicationDelegateProxy and crash when you try access to any property of AppDelegate.

2019-08-17 21:20:08.183948+0300 CS DEV[3789:29536] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RxAppState.RxApplicationDelegateProxy managedObjectContext]: unrecognized selector sent to instance 0x600003ed3240'

Originally posted by @Tayphoon in #11 (comment)

@pixeldock
Copy link
Owner

Thanks for opening this issue! I'll look into it as soon as possible.

@Tayphoon
Copy link
Author

Any updates?

@pixeldock
Copy link
Owner

Sorry, I did not have time to look into it, yet. I am quite busy at the moment, but if you could setup a small demo project to reproduce the problem I promise to have a look at it.

@Tayphoon
Copy link
Author

I make sample you can reproduce crash
StreamSample.zip

@pixeldock
Copy link
Owner

@Tayphoon Awesome, I'll have a look at it!

@jon144
Copy link

jon144 commented Sep 24, 2019

Have you had a chance to look into this problem? If not, do you have an estimate on when you might?

@pixeldock
Copy link
Owner

Hi guys, I'll be on holiday next week, so I will finally find the time to look into this. Sorry for the delay!

@pixeldock
Copy link
Owner

RxAppState 1.6.0 now uses Notifications to create the AppState observables. So from now it does not interfere with the AppDelegate any more. That should fix this issue.

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

3 participants