• 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: Saving "objects" & opening them up in a non-document based App
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving "objects" & opening them up in a non-document based App


  • Subject: Re: Saving "objects" & opening them up in a non-document based App
  • From: "Louis C. Sacha" <email@hidden>
  • Date: Thu, 15 Jan 2004 02:50:59 -0800

Hello...

Take a look at the documentation for NSKeyedArchiver/NSKeyedUnarchiver, and also there is a topic about archiving in the Cocoa Conceptual documentation.

in 10.3 developer docs:

/Developer/Documentation/Cocoa/Conceptual/Archiving/index.html
/Developer/Documentation/Cocoa/Conceptual/Archiving/Tasks/codingobjects.html

in 10.2

/Documentation/Cocoa/TasksAndConcepts/ProgrammingTopics/Archiving/index.html
/Documentation/Cocoa/TasksAndConcepts/ProgrammingTopics/Archiving/Tasks/codingobjects.html


Essentially, you can implement the two methods from the <NSCoding> protocol, encodeWithCoder: and initWithCoder:, and then use an archiver/unarchiver to write/read from your class to a data file.

Hope that helps,

Louis


I have a Cocoa application (non document based) and i want to save the data in a class i created (NSObject:myObject) to a file and be able to open it back up. ive browzed the net but all i find is stuff for document based apps. i really need some help, sample code or tutorials cause i have no idea where to begin.

Aaron Boothello.
_______________________________________________
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.
_______________________________________________
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.

References: 
 >Saving "objects" & opening them up in a non-document based App (From: Aaron Boothello <email@hidden>)

  • Prev by Date: Saving "objects" & opening them up in a non-document based App
  • Next by Date: Re: Saving "objects" & opening them up in a non-document based App
  • Previous by thread: Saving "objects" & opening them up in a non-document based App
  • Next by thread: Re: Saving "objects" & opening them up in a non-document based App
  • Index(es):
    • Date
    • Thread