Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clearing rather than releasing a NSMutableString

I've got a rather large loop that gets a string, does something to it, than goes onto the next one. I was originally releasing it then reallocating it but thought that is a bit of waste of resources but can't figure out how to just clear it out to reuse it.

like image 955
Rudiger Avatar asked Jul 26 '10 06:07

Rudiger


1 Answers

One way would be [myString setString: @""].

like image 50
JWWalker Avatar answered Sep 28 '22 13:09

JWWalker