NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [path objectAtIndex:0];
NSString *databasePath = [documentsDirectory stringByAppendingPathComponent:@"DB"];
NSString *fileName = [newWordbookName stringByAppendingString:@".csv"];
NSString *fullPath = [databasePath stringByAppendingPathComponent:fileName];
[[NSFileManager defaultManager] createFileAtPath:fullPath contents:nil attributes:nil];
[databasePath release];
//[fileName release]; Error!
//[fullPath release]; Error!
//NSLog(@"#1 :databasePath: %d",[databasePath retainCount]);
//NSLog(@"#1 :fileName: %d",[fileName retainCount]);
//NSLog(@"#1 :fullPath: %d",[fullPath retainCount]);
Hi guys, I'm using this code and want to release NSString* ..
so, I declare fileName, fullPath, and databasePath of NSString. But database is released, fileName, fullpath doen't release. I don't know why it happen.
I know that NSArray is Autoreleased. But Is documentsDirectory autoreleased?
(newWordbookName is nsstring type)
I hope that I look through a document about iPhone memory management.
Please advice for me.