• 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: Queue of NSStrings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Queue of NSStrings


  • Subject: Re: Queue of NSStrings
  • From: Nicko van Someren <email@hidden>
  • Date: Wed, 30 Mar 2005 11:59:43 +0100

On 30 Mar 2005, at 11:46, Adam wrote:

I need a queue of NSStrings in my Obj-C/Cocoa application. What is the easiest way to implement this? Do I have to write my own, or does a data structure already exists?

There's no FIFO or stack structures in Objective-C as such but they are trivial to implement. For a queue/FIFO just use an NSMutableArray, add things with addObject: and remove them, with objectAtIndex:0 followed by removeObjectAtIndex:0 Unless you have a vast number of objects you'll likely never notice that it has to memcpy the stack down one word when you remove the items.


	Nicko

_______________________________________________
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: 
 >Queue of NSStrings (From: Adam <email@hidden>)

  • Prev by Date: Moderator: EOT (Re: Copyrighting Application Name)
  • Next by Date: Re: Supporting variable-number of table columns, based on source.
  • Previous by thread: Queue of NSStrings
  • Next by thread: NSCopying is manual labor
  • Index(es):
    • Date
    • Thread