• 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
Re: How to access files in Cocoa application.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to access files in Cocoa application.


  • Subject: Re: How to access files in Cocoa application.
  • From: Joar Wingfors <email@hidden>
  • Date: Thu, 22 Feb 2007 14:21:27 +0100


On Feb 22, 2007, at 9:52 AM, Sachin Kumar Tulla wrote:

Iam new to cocoa application. I need to save the data from cocoa application to a normal text file. How to proceed with??

Beside the things that has been mentioned in this thread so far, you might also want to have a look at:


	-[NSString writeToFile:atomically:encoding:error:] (Writing), and
	+[NSString stringWithContentsOfFile:encoding:error:] (Reading)

NSData, NSArray and NSDictionary also have similar simple ways to read to / write from files.

Archiving and data serialization topics will probably also be of interest:

<http://developer.apple.com/documentation/Cocoa/Conceptual/Archiving/ index.html>
<http://developer.apple.com/documentation/Cocoa/Conceptual/ PropertyLists/index.html>


See also the recommendations for where to store user data in the file system, and how to locate these special locations:

<http://developer.apple.com/documentation/MacOSX/Conceptual/ BPFileSystem/Articles/WhereToPutFiles.html>
<http://developer.apple.com/documentation/Cocoa/Conceptual/ LowLevelFileMgmt/Concepts/PortableFSOps.html>
<http://developer.apple.com/documentation/Cocoa/Conceptual/ LowLevelFileMgmt/Tasks/LocatingDirectories.html>


Finally, if you're thinking about persistence of user preferences and other small snippets of per-user data you should use NSUserDefaults and not your own file based storage.

j o a r


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >How to access files in Cocoa application. (From: Sachin Kumar Tulla <email@hidden>)

  • Prev by Date: Re: Cocoa-dev Digest, Vol 4, Issue 176
  • Next by Date: Re: Core Data OpenGL
  • Previous by thread: Re: How to access files in Cocoa application.
  • Next by thread: Re: Cocoa-dev Digest, Vol 4, Issue 176
  • Index(es):
    • Date
    • Thread