• 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
Adding a hidden coredata layer in a cocoa framework ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Adding a hidden coredata layer in a cocoa framework ?


  • Subject: Adding a hidden coredata layer in a cocoa framework ?
  • From: Kubernan At 10191 Technologies <email@hidden>
  • Date: Mon, 11 Jun 2007 20:49:09 +0200

Hello,

I'm studying the add of coredata (cd) in my cocoa framework. I'd like to integrate cd making it invisible
for clients : each class of my framework will have its hidden entity in a mom.
I have difficulties to manage the coredata stack in a framework.


Imaging a framework with two classes (subclassing NSObject) : Book and Author. The mom contains two entities : EBook dedicated to Book class, EAuthor for Author class. The client plays with Book and Author and these classes play with EBook and EAuthor.
That said, creating a Book should be simple like that :
Book *newBook = [Book book]; // it creates an instance of EBook.
and setting the book's author :
[newBook setAuthor:[Author author]]; // it creates an instance of EAuthor and sets the relationhsip EBook<<-->>Author.


At this time i don't know how to manage the cd stack : each new instance of EBook or EAuthor can have its own managed object context (allocated in +(id)book and in +(id)author methods) but what about the persistent store ? I think i should use an in memory store until the client performs a save operation somewhere in the disk but how to make this store common to EBook and EAuthor instances ?

An idea ?

Thanks for your help,
K.
_______________________________________________

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


  • Prev by Date: Re: NSImage Info
  • Next by Date: Re: Error and Exception Handling: When to use
  • Previous by thread: Re: Client Development Question
  • Next by thread: Child windows
  • Index(es):
    • Date
    • Thread