appending text to files
appending text to files
- Subject: appending text to files
- From: Robert Dell <email@hidden>
- Date: Sat, 19 Nov 2005 16:32:24 -0500
I posted this to comp.lang.objective-c and got no response so i'm going to ask here (and probably get nailed for asking)
in NSString.h, i see the following line
- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)useAuxiliaryFile;
i need to append a NSMutableString to a file that already exists. is there any built-in method to do this?
i currently have this
if (isLogging)
{
NSMutableString *mystring1 = [[[NSMutableString alloc] init] autorelease];
if ([logString length] > 0)
{
[mystring1 setString: [NSString stringWithContentsOfFile: logFileName]];
[mystring1 appendString: logString];
[logString setString: @""];
[mystring1 writeToFile: logFileName atomically: NO];
}
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden