• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Subclassing a NSMutableArray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subclassing a NSMutableArray


  • Subject: Re: Subclassing a NSMutableArray
  • From: Ondra Cada <email@hidden>
  • Date: Thu, 16 Mar 2006 18:35:25 +0100

Lorenzo,

On 16.3.2006, at 16:57, Lorenzo wrote:

I would
like to send the same commands to all the items of the array of the objects
selected. The 20 commands are like
[item setParam:par to:theValue verbose:YES];


so I cannot use
    makeObjectsPerformSelector:(SEL)aSelector withObject:(id)anObject

A clean indication you need a HOM (High Order Messaging) framework, in which case the code looks kind of like


[[array do] setParam:par to:theValue verbose:YES];

Yeah, it's that easy.

Far as I know, the best free HOM implementation is the one of Marcel Weiher: check www.metaobject.com.

Other than that...

But subclassing an anbstarct class like NSMutableArray seems to be
impossible. Is it true?

You want to read the docs on class clusters and on categories, of which class clusters explain how to subclass an array (and also why it is not what you actually want to do :)), and a category could help to solve your problem, although--compared with HOM--a pretty clumsy way.
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Subclassing a NSMutableArray (From: Lorenzo <email@hidden>)

  • Prev by Date: Re: NSTextView question
  • Next by Date: Re: Subclassing a NSMutableArray
  • Previous by thread: Re: Subclassing a NSMutableArray
  • Next by thread: Re: Subclassing a NSMutableArray
  • Index(es):
    • Date
    • Thread