• 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
Memory Management Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Memory Management Question


  • Subject: Memory Management Question
  • From: Mike Burns <email@hidden>
  • Date: Fri, 25 May 2007 21:03:45 -0400

I saw a question similar to this posted a few weeks ago to no reply, so I thought I'd throw out my own version and see if got any takers...

In my continuing effort to build a World Builder-like application, I have come across another issue that I can't seem to wrap my head around. In my application the user is allowed to build scenes (basically a collection of NSBezierPath shapes) and all sorts of other data (text, sounds, etc). When they are through creating their game, the user can "build an application" -- done by (as some of you suggested) plugging in their project data objects in to a player application (created by me and bundled in the editor).

Now I have created some of these objects and I'm unsure how to go about storing them. For instance, my Scene object contains a scene name, scene window frame, scene text, and array of graphic elements. The way I have been going about it is to have an NSDictionary that stores all of the scenes, and then when it's time to save the project it writes it to a file using NSKeyedArchiver.

This occured to me -- by doing this I am potentially storing thousands of these scene objects in memory. That just seems off to me. Should I be saving each scene in its own individual file and loading it from disk as it needs to be edited/display? Or better yet, is there a way that I can archive/unarchive specific objects from one file using NSKeyedArchiver? (So I could save all my scenes in one file).

Any help would be appreciated!
_______________________________________________

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


  • Follow-Ups:
    • Re: Memory Management Question
      • From: Andreas Mayer <email@hidden>
  • Prev by Date: Re: How to capture my desktop?
  • Next by Date: NSTreeController vs. representedObject
  • Previous by thread: Re: How to capture my desktop?
  • Next by thread: Re: Memory Management Question
  • Index(es):
    • Date
    • Thread