• 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
[basic] writeToFile .plist best method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[basic] writeToFile .plist best method


  • Subject: [basic] writeToFile .plist best method
  • From: clunkyrobot <email@hidden>
  • Date: Wed, 28 Jul 2004 17:53:31 +1000

hi - I am writing a plist file and have some basic questions.

1- do I need to call my file a somefile.plist can I just give it my own extension like somefile.myfile?

2- I am allocating the file name dynamically, I did this like this:

fileName = [nameField stringValue];
[records writeToFile:[fileName stringByAppendingString:@".plist"] atomically:TRUE];

however when I construct a path name for the file as in I wish to save somefile.plist on the Desktop I am
doing it this way:

noting that records is a dictionary.

[records writeToFile:[ [ [@"~/Desktop/" stringByAppendingString:fileName] stringByAppendingString:@".plist"] stringByExpandingTildeInPath ] atomically:TRUE];

Is this the best way, just incase I have to many square braces?

-Kurt
_______________________________________________
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: [basic] writeToFile .plist best method
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: Crash with NSPrintOperation ?!
  • Next by Date: Re: WebKit BaseURL problems
  • Previous by thread: Re: Custom Widget
  • Next by thread: Re: [basic] writeToFile .plist best method
  • Index(es):
    • Date
    • Thread