Hello all,
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 NSArray *tokens = [values componentsSeparatedByString:@":"];
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.
Michael