• 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: lots of find/replace in text file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lots of find/replace in text file


  • Subject: Re: lots of find/replace in text file
  • From: Greg Guerin <email@hidden>
  • Date: Sat, 22 Jan 2011 10:35:22 -0700

Jeremy Matthews wrote:

I can't help but think there might be a better (and more efficient way) of handling this?


How much better (and more efficient) does it have to be?

It's a simple game, right? Is it currently too slow or memory- consuming? If not, why change it?

If you want a different design for some reason, maybe look into doing the template-file parsing only once. Break it into a sequence of literal strings and replaceable strings in an NSArray. To produce output, walk the array and output either a literal string or a replaced string at each element. Or make a mutable copy of the array and use componentsJoinedByString: after replacing the replaceable items with their replacement strings. That won't necessarily be better or more efficient, just different.

  -- GG

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: printing a different representation than what is on the screen
  • Next by Date: Re: starting with Cocoa!
  • Previous by thread: Re: lots of find/replace in text file
  • Next by thread: Re: lots of find/replace in text file
  • Index(es):
    • Date
    • Thread