• 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: Preserving user interface properties in Core Data documents
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preserving user interface properties in Core Data documents


  • Subject: Re: Preserving user interface properties in Core Data documents
  • From: "I. Savant" <email@hidden>
  • Date: Thu, 26 Apr 2007 16:33:40 -0400

On 4/26/07, Sean McBride <email@hidden> wrote:
What is the recommended way to preserve UI properties as part of a
document?  For example: window sizes, window position, table column
sizes, etc.

There're two perfectly good approaches I can think of:

1 - Store them as a dictionary in your store's meta data (see
NSPersistentStoreCoordinator's -metadataForPersistentStore: and
-setMetadata:forPersistentStore: methods).

 or

2 - Create an entity called "Settings" or some-such, always make sure
your document has a single instance of this entity (try to retrieve
one on opening, if none, create one), and create attributes like
"windowSize" (which you could store as an NSRect()->NSValue->NSData or
as a string (NSStringFromRect()), etc.).

--
I.S.
_______________________________________________

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: Preserving user interface properties in Core Data documents
      • From: "I. Savant" <email@hidden>
References: 
 >Preserving user interface properties in Core Data documents (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: NSArray - waste of time?
  • Next by Date: Re: Preserving user interface properties in Core Data documents
  • Previous by thread: Preserving user interface properties in Core Data documents
  • Next by thread: Re: Preserving user interface properties in Core Data documents
  • Index(es):
    • Date
    • Thread