Subclassing and private methods
Subclassing and private methods
- Subject: Subclassing and private methods
- From: Rick Aurbach <email@hidden>
- Date: Wed, 07 May 2014 15:24:01 -0400
- Acceptlanguage: en-US
- Thread-topic: Subclassing and private methods
I am using a CocoaPod that ALMOST does what I want it to. It appears that I can get the desired behaviors by subclassing it (creating a category is also a possibility, although doing so has the same problems as subclassing).
Obviously, I would like to create as minimal a subclass as possible (and avoiding duplicating existing code), but doing so requires access to private methods of the original object. The problem is that I need to use methods which are not declared outside of the @implementation section of the class and a property which is ONLY declared in the class’s anonymous category interface (i.e., @interface theClass () … @end)..
Now I understand that trying to gain access to private methods is generally a BAD IDEA, since almost any change to the original CocoaPod could break my class. And I may (i.e., probably will) resolve the issue by duplicating otherwise unnecessary code in my subclass. But before I do so, I’d like to survey what people think, how they approach this problem, etc.
(This is sort of like the undefined selector issue that has been discussed recently, but seems to me to be a slightly different wrinkle.)
What do you do??
Cheers,
Rick Aurbach
Aurbach & Associates, Inc.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden