Skip to content

Comment on TheKitchenSync - A Tool Belt for iOS Concurrencyparent

Comments

You can test easily! [array isKindOfClass:[NSMutableArray class]] or [array respondsToSelector:@selector(insertObject:)]

Have you actually tried it? Because the people who have (me included) found that both tests will return YES, yet when you try a mutable operation you get an exception.

http://stackoverflow.com/questions/1788690/objective-c-how-t...

http://www.cocoabuilder.com/archive/cocoa/224795-nsdictionar...

You cannot use `isKindOfClass:` to introspect an array like this. Most of the toll-free bridged foundation classes such as arrays/dictionaries/sets are implemented as class clusters.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.