|
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
[Prev in Thread] | Current Thread | [Next in Thread] |