mxcl/YOLOKit

v11.1 Broke array.map

oztune opened this issue · 3 comments

This change is causing a crash for me since I updated to 11.1

11...11.1#diff-4bbdff7cda9b63e25e2e8865533250d4L31

Error:

method only defined for abstract class.  Define -[__NSCFArray initWithCapacity:]!

When subclassing or extending NS class clusters like NSArray we need to be extra careful about what assumptions the code makes (https://mikeash.com/pyblog/friday-qa-2010-03-12-subclassing-class-clusters.html).

This is a pretty serious issue so I'm reverting to 11.0 for now.

mxcl commented

Sorry for the delay.

FYI in future this would be fixed if you did a -[ copy] first. It happens because NSArray is a class cluster and some of the reimplementations don't support typical constructors and it's hard to test for that.

Really I should never have accepted the fmap patch but at the time it seemed prudent.

Thanks! I believe map for NSDictionary and NSSet also made the same assumptions though.

mxcl commented

Fixed those too thanks.