Re:TheKitchenSync - A Tool Belt for iOS Concurrency
by andrewroycarter on Monday May 13, 2013 @06:35PM
(#5701885)
You can test easily! [array isKindOfClass:[NSMutableArray class]] or [array respondsToSelector:@selector(insertObject:)]
[ Parent
| on HN ]
Re:TheKitchenSync - A Tool Belt for iOS Concurrency
by rogerbinns on Tuesday May 14, 2013 @01:33AM
(#5703135)
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...
Re:TheKitchenSync - A Tool Belt for iOS Concurrency
by blakewatters on Tuesday May 14, 2013 @09:49AM
(#5704767)
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.