This is a prime use for Higher Order messaging: 
http://www.metaobject.com/papers/Higher_Order_Messaging_OOPSLA_2005.pdf
 http://www.cocoadev.com/index.pl?HigherOrderMessaging
http://www.oreilly.com/pub/a/mac/2004/07/16/hom.html
 
HOM takes this

// which of these employee objects earn more than 1000 Euros.
int i;
id salariedEmployees = [NSMutableArray array];
for (i = 0 ; i < [employees count] ; i++ )
{ 
   id employee = [employees objectAtIndex: i ];
   if ( [employee hasSalary: 1000] ) 
   { 
      [salariedEmployees addObject: employee];
   }
}

and turns it into this

salaried=[[employees select] hasSalary: 1000] ;

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to