Hacker News new | ask | show | jobs
by Zev 4894 days ago
Can you give an example of some things that you subclass?
1 comments

From Foundation? NSDictionary, NSArray and NSOperation instantly jump to mind.
What do you get out of subclassing NSDictionary or NSArray that you don't get out of a category?
Well in this case I subclassed them so I could have the backing data source only weakly reference the items in the dictionary/array and because I subclassed them I can use them wherever NSDictionary or NSArray is an accepted parameter.

Apple's documentation also gives some examples:

https://developer.apple.com/library/ios/#documentation/Cocoa...

https://developer.apple.com/library/ios/#documentation/Cocoa...

Why not use CFDictionaryRef and pass it along via toll-free bridging?
I'm confused. How is that any easier? It's six of one, half dozen of the other.

I'd much prefer to write Objective-C code than pure C.