Hi Guys,
I am trying to read in a file to a NSString and then creat a NSMutableArray to store the contents divided by "\n". However, after release the array, it looks like the memory still not released. The memory was increasing to 20MB after alloc the array and was still occupied after releasing the array. The memory of NSString can be released no problem. No memory leaks.
Any help will be appreciated.
I am trying to read in a file to a NSString and then creat a NSMutableArray to store the contents divided by "\n". However, after release the array, it looks like the memory still not released. The memory was increasing to 20MB after alloc the array and was still occupied after releasing the array. The memory of NSString can be released no problem. No memory leaks.
Any help will be appreciated.
HTML:
/////////////////////
//read in test.txt
NSString *defaultDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"test.txt"];
NSError *error;
NSString *testtest = [[NSString alloc] initWithContentsOfFile:defaultDBPath encoding:NSASCIIStringEncoding error:&error];
NSMutableArray *Rna = [[NSMutableArray alloc] initWithArray: [testtest componentsSeparatedByString:@"\n"]];
[testtest release];
/////////////////////
//remove all temp arrays
[Rna removeAllObjects];
[Rna release];