• 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
Saving a NSMutableArray into a plain ASCII file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Saving a NSMutableArray into a plain ASCII file


  • Subject: Saving a NSMutableArray into a plain ASCII file
  • From: Frank Blome <email@hidden>
  • Date: Tue, 28 May 2002 23:48:29 +0200

Hello again,

First of all I like to thank you all fellows here on the list, I never had found a resource where Iearned so much in a really short time. With every day I come closer and closer to the concepts of the Cocoa framework and learn how to read it (the documentation is IMHO not really the easiest one ;-) Therefore: THANK YOU GUYS! Hopefully in the near future I can help you at some issues :-)

I like to save the contents of a NSMutableArray into a file. My method therefore is:

- (IBAction) saveFile:(id)sender
{
NSString *configFile;
configFile = [NSString stringWithString:@"~/myfile.txt"];
configFile = [configFile stringByExpandingTildeInPath];
[contents writeToFile:configFile atomically:YES];
}

This works fine, but the result is a XML-Format, which is obviously right,
since "contents" is an Array. But I need the file back in a standard UNIX format (linefeed at the end and so on). Unfortunately I did not found any method in the documentation which put my Array (actually a NSMutableArray)
into a NSString. I search for this method, because I believe this is the way to save it. If not, feel free to advise me.

Another point is the header of the column in a NSTableView. I found in the documentation, that I have to use "setTitle" to give the header a NSString.
But unfortunately I can't manage it.

Frank
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Saving a NSMutableArray into a plain ASCII file
      • From: Phillip Morelock <email@hidden>
    • Re: Saving a NSMutableArray into a plain ASCII file
      • From: Marcel Weiher <email@hidden>
  • Prev by Date: Re: Length of globallyUniqueString
  • Next by Date: Re: Saving a NSMutableArray into a plain ASCII file
  • Previous by thread: Re: Class ?> Framework
  • Next by thread: Re: Saving a NSMutableArray into a plain ASCII file
  • Index(es):
    • Date
    • Thread