• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
appending text to files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: appending text to files
      • From: Markus Hitter <email@hidden>
  • Prev by Date: Re: Target properties "Executable" field
  • Next by Date: Re: appending text to files
  • Previous by thread: Re: Namespace bug?
  • Next by thread: Re: appending text to files
  • Index(es):
    • Date
    • Thread