Re: NSQueue equivalent?
Re: NSQueue equivalent?
- Subject: Re: NSQueue equivalent?
- From: "John C. Randolph" <email@hidden>
- Date: Tue, 19 Feb 2002 14:33:57 -0800
On Tuesday, February 19, 2002, at 10:33 AM, Steve Mykytyn wrote:
It would be helpful to have a class like "NSQueue" that allowed
one to put in objects and take them out FIFO or LIFO. A search
of the documentation didn't reveal any obvious ways to
accomplish this. Any suggestions? Won't be that hard to write
one, but would rather not reinvent the wheel...
I remember asking about this sometime last year, and it turns
out that NSMutableArray is quite suitable for this, since its
implementation uses a circular buffer. I wrote a few perlisms
like -push:, -pop, -shift: and -unshift to add and remove
objects from the head and tail of the array.
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.