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: Mick Bert
Subject: Re: NSMutableString -initWithFormat appends to existing text
Date: Wed, 18 Apr 2018 11:23:27 +0200

2018-04-18 9:52 GMT+02:00 H. Nikolaus Schaller <hns@goldelico.com>:
>
> -init or -initWithFormat: should be called only once and only after +alloc.
> You use stringWithCapacity which has already been initialized.
>
> Use -setString:@"" followed by -appendWithFormat: instead.
>
Thanks a lot!
Now it works as expected.

One question more. I am writing in a text file, by formatting NSString
objects to give to NSFileHandle -writeData.
Is it the preferable way? Are there any other class to work with
text-oriended files?

--
Mick



reply via email to

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