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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to