• 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: Storing Instances of a structure in a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Storing Instances of a structure in a file


  • Subject: Re: Storing Instances of a structure in a file
  • From: Phil <email@hidden>
  • Date: Sun, 21 Sep 2008 22:57:54 +1200

On Sun, Sep 21, 2008 at 9:13 PM, Adil Saleem <email@hidden> wrote:
> Hi,
>
> I want to store instances of a structure in a file so that my application can retreive them and read them.(Basically they are different configuration presets for the application) I also want each instance that is stored to be unique. I know this becomes a typical database problem but i don't want to use database.
>
> Is there any Cocoa API that can help me with this problem ? I know it can be done in plain C language, but that would be lengthy and error-prone. If there is anything in Cocoa that can help me, it would be great.
>

If you're talking about plain-C structs then you can wrap them up in
NSValue or NSData instances, which you can then write out with an
NSCoder (or if you have lots of them, put them into an NSArray and do
the same).

Phil
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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

  • Follow-Ups:
    • Re: Storing Instances of a structure in a file
      • From: Adil Saleem <email@hidden>
References: 
 >Storing Instances of a structure in a file (From: Adil Saleem <email@hidden>)

  • Prev by Date: Storing Instances of a structure in a file
  • Next by Date: Re: Storing Instances of a structure in a file
  • Previous by thread: Storing Instances of a structure in a file
  • Next by thread: Re: Storing Instances of a structure in a file
  • Index(es):
    • Date
    • Thread