• 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: NSDictionary writeToFile without going to disk?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDictionary writeToFile without going to disk?


  • Subject: Re: NSDictionary writeToFile without going to disk?
  • From: Tito Ciuro <email@hidden>
  • Date: Sun, 19 Mar 2006 10:31:52 -0800

Hi Adam,

Unfortunately, NSData is returned. I was hoping for NSString because I need to search the contents. The writeToFile/ dictionaryWithContentsOfFile works fine... I just wish there was an equivalent method to do that without having to go to disk...

Thanks a lot,

-- Tito

On 19/03/2006, at 10:13, Adam R. Maxwell wrote:


On Mar 19, 2006, at 10:01, Tito Ciuro wrote:

Hello,

I know I can store a dictionary and read it back using:

- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)flag

+ (id)dictionaryWithContentsOfFile:(NSString *)path

I need to store the dictionary plist in a DB for later retrieval (and thus recreating the dictionary), so I'm afraid this mechanism will be slow if I have to store lots of them.

Is there a way to do the same on-the-fly, that is, without having to go to disk?

+[NSArchiver archivedDataWithRootObject] (and corresponding unarchiver) will convert it to NSData, if everything in the dictionary conforms to NSCoding. You could also check out NSPropertyListSerialization.


hth,
Adam



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: NSDictionary writeToFile without going to disk?
      • From: "Adam R. Maxwell" <email@hidden>
    • Re: NSDictionary writeToFile without going to disk?
      • From: "John C. Randolph" <email@hidden>
References: 
 >NSDictionary writeToFile without going to disk? (From: Tito Ciuro <email@hidden>)

  • Prev by Date: NSDictionary writeToFile without going to disk?
  • Next by Date: Re: NSDictionary writeToFile without going to disk?
  • Previous by thread: NSDictionary writeToFile without going to disk?
  • Next by thread: Re: NSDictionary writeToFile without going to disk?
  • Index(es):
    • Date
    • Thread