Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • can you show .h and .m of Geology..? Commented Dec 2, 2012 at 11:01
  • 3
    NSArray is a class cluster. So even though the exposed classes you see are NSArray and NSMutableArray, those are merely interfaces. The actual object you get back could be from a myriad of classes. That's why it's generally a bad idea to subclass from a class cluster. Howeve, if you must subclass, then read the Subclassing Notes from the docs. Basically, there are a few more methods you have to override both from NSMutableArray and NSArray. Commented Dec 2, 2012 at 11:17
  • Ah thank you. I guess I'll drop that idea and just reuse the code. Commented Dec 2, 2012 at 11:21
  • If you need/want to encapsulate this, you could use class composition instead of subclassing so that you don't have to worry about the class clusters. Commented Dec 2, 2012 at 15:04