• 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
Sometimes, the smallest snippets of code..
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sometimes, the smallest snippets of code..


  • Subject: Sometimes, the smallest snippets of code..
  • From: "John C. Randolph" <email@hidden>
  • Date: Mon, 23 Jul 2001 05:10:47 -0700

I just squished a whole lot of code into considerably less code when I implemented this:

@implementation NSInvocation (IX_InvocationExtensions)

- (void) invokeWithCollection: aCollection
/*"Invokes the reciever with every object contained in aCollection. aCollection can be any object that responds to -objectEnumerator, which includes arrays and sets."*/
{
id
obj;

NSEnumerator
*gimme = [aCollection objectEnumerator];

while (obj = [gimme nextObject])
[self invokeWithTarget:obj];
}

@end

I almost had a psychic girlfriend, but she left me before we met. -- Steven Wright


  • Prev by Date: Re: Goofy NSDrawer behavior
  • Next by Date: Re: Obj-C vs Java
  • Previous by thread: Thread Safty Deja Vu (retain/autorelease or lock/unlock?)
  • Next by thread: DO vs NSLock with threads and AppKit
  • Index(es):
    • Date
    • Thread