Re: How do I give a set of methods to some objects but not others?
Re: How do I give a set of methods to some objects but not others?
- Subject: Re: How do I give a set of methods to some objects but not others?
- From: Scott Andrew <email@hidden>
- Date: Sat, 25 Nov 2006 08:34:43 -0800
- Thread-topic: How do I give a set of methods to some objects but not others?
I can see a couple of ways to do this:
1.) If there is a shared instance you can extend NSObject and add your
functions to you NSObject extension. We do with NSStrings to interface with
our crossplatform library.
2.) You can write a helper class that as the functionality you need and
provide acessors in your class.
3.) Create a common base class or protocol that all objects derive from that
defines your functionality.
All three work very well depending on your design and situation. I would
vote for 3 or 2 personally.
Scott Andrew
> From: Alan Smith <email@hidden>
> Date: Fri, 24 Nov 2006 10:36:11 -0500
> To: John Stiles <email@hidden>
> Cc: cocoa <email@hidden>
> Subject: Re: Re: How do I give a set of methods to some objects but not
> others?
>
> HmmÂ
>
> Yes, that would work except Class A, B, and C all inherit from
> different classes. Maybe it is I that is missing something?
>
> --
> // Quotes from yours truly -------------------------
> "You don't forget, you just don't remember."
> "Maturity resides in the mind."
> "Silence is the Universe's greatest gift."
> "When the World realizes that religion really is unnecessary, then it
> shall evolve."
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> 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
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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