Assertion in -[RACStream flattenMap:] fails with RACSubject from rac_signalForSelector: #1085

Closed
sebreh opened this Issue Feb 2, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@sebreh
Contributor

sebreh commented Feb 2, 2014

This assertion in -[RACStream flattenMap:] fails deep down in the stack trace from subscribeNext: when it is passed a RACSubject that resulted from calling rac_signalForSelector: on an object. I will keep digging, but it seems this is due to the swizzling happening in rac_signalForSelector: (which, I must admit, I don't fully understand yet), where the object returned is not actually an instance of RACSubject (and thus, not a subclass of RACStream) although its class property indicates it is. Breaking on the assertion and printing some info gives me the following:

(lldb) po value
<RACSubject: 0xea504c0> name: <PodioAppDelegate_iPhone: 0xe777600> -rac_signalForSelector: application:performFetchWithCompletionHandler:
(lldb) po [value class]
RACSubject
(lldb) p (BOOL)[value isKindOfClass:[RACSubject class]]
(BOOL) $6 = NO

Any idea what might be going on? It seems to me the asserted condition might be too strict in this case?

@kastiglione

This comment has been minimized.

Show comment Hide comment
@kastiglione

kastiglione Feb 3, 2014

Member

Have a look at #901. The failing -isKindOfClass: assertion is typically the manifestation of having two distinct definitions of a given class. In this case it would seem there are two RACSubject classes.

Member

kastiglione commented Feb 3, 2014

Have a look at #901. The failing -isKindOfClass: assertion is typically the manifestation of having two distinct definitions of a given class. In this case it would seem there are two RACSubject classes.

@sebreh

This comment has been minimized.

Show comment Hide comment
@sebreh

sebreh Feb 6, 2014

Contributor

Ah that did it, I needed to only include it in the app target and not my unit test target. Thanks!

Contributor

sebreh commented Feb 6, 2014

Ah that did it, I needed to only include it in the app target and not my unit test target. Thanks!

@sebreh sebreh closed this Feb 6, 2014

@kastiglione

This comment has been minimized.

Show comment Hide comment
@kastiglione

kastiglione Feb 6, 2014

Member

Great, glad that was it. Enjoy!

Member

kastiglione commented Feb 6, 2014

Great, glad that was it. Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment