• 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: NSQueue equivalent?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >NSQueue equivalent? (From: Steve Mykytyn <email@hidden>)

  • Prev by Date: Re: NSMatrix: which selectors?
  • Next by Date: Re: Command-Line Compilers?
  • Previous by thread: Re: NSQueue equivalent?
  • Next by thread: Re: NSQueue equivalent?
  • Index(es):
    • Date
    • Thread