• 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: Parsing cString - Silly question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parsing cString - Silly question


  • Subject: Re: Parsing cString - Silly question
  • From: Wain <email@hidden>
  • Date: Fri, 18 Nov 2005 15:24:33 +0000


On 18 Nov 2005, at 15:13, Lorenzo wrote:

Hi,
how can I add an element to an array of float?
I am parsing a text file contains variables, but until I parse the whole
text I cannot know how many variables that text contains.
Actually I parse the text twice. The first time I count the variables.
Is a way to do everything in one loop only? Will be faster?

You could use an NSNumber to store the float and then use an NSMutableArray to store the numbers, assuming your using Cocoa and you don't really need a float array?!?.

It depends on the size of the file and your parsing mechanism
as to any speed loss/gain, you won't need to parse twice though
as you can simply make the array bigger as you go...

If you are creating the text file rather than being supplied it, you could
even change the file format and use a property list to store the variables :-)


Wain


___________________________________________________________ WIN ONE OF THREE YAHOO! VESPAS - Enter now! - http://uk.cars.yahoo.com/features/competitions/vespa.html
_______________________________________________
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: 
 >Parsing cString - Silly question (From: Lorenzo <email@hidden>)

  • Prev by Date: Re: NSImageView does not update on setNeedsDisplay
  • Next by Date: Re: How to make sure that end of string is visible in NSTextField
  • Previous by thread: Re: Parsing cString - Silly question
  • Next by thread: Re: Parsing cString - Silly question
  • Index(es):
    • Date
    • Thread