Re: lots of find/replace in text file
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