Aspects
Aspects copied to clipboard
Unrecognized selector sent to instance - Debugging
Following up on the previous issue:
I added a stub implementation to the view controller in question that was crashing
Now I can see that the crash is stemming from :
// Instead hooks.
BOOL respondsToAlias = YES;
if (objectContainer.insteadAspects.count || classContainer.insteadAspects.count) {
aspect_invoke(classContainer.insteadAspects, info);
aspect_invoke(objectContainer.insteadAspects, info);
}else {
Class klass = object_getClass(invocation.target);
do {
respondsToAlias = [klass instancesRespondToSelector:aliasSelector]; // HERE
if (respondsToAlias) { //was (respondsToAlias = [klass instancesRespondToSelector:aliasSelector])
[invocation invoke];
break;
}
}while (!respondsToAlias && (klass = class_getSuperclass(klass)));
}
Removing the empty implementation from the view controller causes a crash with no clear backtrace.