I generally think in code and algorithms which explains the slight delay in responding when spoken to. But for the most part, I appear to be reasonably well adjusted to my surrounding social environment.
I write software in Objective-C and Java and recently started writing a book in English, which is a surprising development for me given that my native language is French.
Located in Jacksonville, FL. Also on Twitter @michaelprivat

Hi Michael,
I see that you’ve got a Core Data book coming out. Something I’m wondering about. Does it cover any details about creating additional managed object contexts in an app? Or what I’m trying to solve below?
I’ve been hacking around for months on an answer to putting together a part of an app like iPhone preferences app but with Core Data. The right pattern with core data isn’t apparent to me and there isn’t much data out there with examples in the web hemisphere, on ADC, and a lot of reputable developers I’ve come in contact with are simply too busy.
Looking for a top level Table View with 4-5 static rows to basically launch off separate detail or table views for add/edit/delete with separate supporting Core Data entities/attributes. Obviously from didSelectRowAtIndexPath in the implementation file of the top level table view.
Thoughts?
Thanks,
Adam
Adam,
I don’t think you’d want to create several managed object contexts for your app because it becomes difficult to manage the integrity of the object graph. The book does cover multiple persistence stores but I’m not convinced it would be necessary for a preference app. Have you come up with a data model yet? What in you opinion is the constraint stopping you from using a normal Core Data setup?
Michael
If the rows are static then you could have a model that has 4-5 subsections to support the specific preferences. But it would still all be part of the same model. To be a bit more generic, you could find a way to define your preferences generically. May be a preferences would be an entity defined as:
Preference(name:string, type={checkbox,textfield,etc…}, value:string)
Then create an Entity for Category (or whatever makes sense in the context of your app) that has a 1-to-many relationship to Preference. Then your table top level can show the categories and as you select one, it lays its preferences out using the type attribute to figure out how it should look like.
Just an idea…
Hi Michael,
Thanks for the replies! I definitely think I went down a wrong path regarding this multi-moc for my needs. I realize from your two posts that I may in fact need to take a more generic data driven approach as you suggest, also do some re-modelling.
I had a look at this library out on google code http://code.google.com/p/coredatalibrary/. This really takes the approach farther than I think I need.. Maybe we could meet up and I’ll show you the app.
Thanks,
Adam
I just noticed that you’re located in Jacksonville… I am as well, and your name sounds very familiar for some reason.
Hey Michael, I realize this thread probably doesn’t belong on your “About” section….
Take Care,
Adam
No worries. I’ll email you. We’ll talk
Hi Michael,
I’m trying to buy a copy of your book but, currently residing in Thailand, I can’t buy it at B & N, and I don’t have Kindle, so Amazon is out. I’d prefer it in a PDF. Failing that, I guess I’d prefer to read it on either my Sony or my iPad.
So…where can I make the purchase from Thailand in one of these formats?
Wayne
Wayne, I believe you can buy a PDF at http://www.apress.com/9781430233558
If the rows are static then you could have a model that has 4-5 subsections to support the specific preferences. But it would still all be part of the same model. To be a bit more generic, you could find a way to define your preferences generically. May be a preferences would be an entity defined as:Preference(name:string, type={checkbox,textfield,etc…}, value:string)Then create an Entity for Category (or whatever makes sense in the context of your app) that has a 1-to-many relationship to Preference. Then your table top level can show the categories and as you select one, it lays its preferences out using the type attribute to figure out how it should look like.Just an idea…
+1