Take the 2-minute tour ×  I have a simple method to read a
string and parse it to an array,  -(NSArray *) readFileToArray:
(NSString *)file{     NSString *values = [NSString
stringWithContentsOfFile: file];     NSArray *tokens = [values
componentsSeparatedByString:@":"];      return tokens;  however
instruments did report me I got a leak on NSString at line   I
have no idea why this happens, 1). I think both values and
tokens are autoreleased? Am I right? 2). I tried to release
values and tokens(just a try), it crashes.  Thanks for your help
in advance.   share|improve this question If you tag objective
and c you'll only get answers from Objective and C programmers.
–  Pascal Cuoq Jan 29 '10 at 22:45 add comment  2 Answers  The
code you've posted is using correct memory management (the
return value is autoreleased). Look at the code that is calling
readFileToArray: to see how it's handling the returned array.
share|improve this answer Darren, Thanks for your answer. – 
user238009 Jan 30 '10 at 21:21 add comm