Best way to initialise / clear a string variable cocoa

Posted by Spider-Paddy on Stack Overflow See other posts from Stack Overflow or by Spider-Paddy
Published on 2010-05-27T14:52:33Z Indexed on 2010/05/27 15:01 UTC
Read the original article Hit count: 188

Filed under:
|
|
|

I have a routine that parses text via a loop. At the end of each record I need to clear my string variables but I read that someString = @"" actually just points to a new string & causes a memory leak.

What is the best way to handle this? Should I rather use mutable string vars and use setString:@"" between iterations?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about parser