discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMutableString -initWithFormat appends to existing text


From: Riccardo Mottola
Subject: Re: NSMutableString -initWithFormat appends to existing text
Date: Wed, 18 Apr 2018 15:00:48 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.1

Hi Mick,


Mick Bert wrote:
I mean: now, that I applied the above suggestion, it works ^__^

the mantra is: allocate and init once.
For static classes, that's also the only thing you can do (e.g. NSArray, NSString....) for mutable objects, then you need to use mutation methods (e.g. NSMutableString, NSMutableArray....)


With test-oriented i mean generic text streams, organized as a sequence of
variable length lines, separated by new-line character. Very generic readable
text.

I cannot load the entire file in memory, because it is too big. Thus I
process it
line by line, writing the output in an other file.

You can write the stream directly, it may work for you, also for quite big data, it is efficient.

Otherwise indeed, work with NSFileHandle

https://www.gnu.org/software/gnustep/resources/documentation/Developer/Base/Reference/NSFileHandle.html


Riccardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]