Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 10-24-2010, 10:17 PM   #1 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 8
benbarnett is on a distinguished road
Question Core Data Design Pattern

I am trying to work out the best way to integrate Core Data into my app. I have read through the Core Data Programming Guide and I have a decent idea on how to use it but all of the examples I have seen use Core Data requests like Fetch or Insert in ViewControllers. I'd really like some way to increase how much code I reuse, like all good programmers should, but I am having trouble doing this.

My current idea is to sub-class the Managed Objects that are created from the Object Model and put common tasks in there like creating, fetching, saving and deleting objects (pretty much all of the standard CRUD operations) so that I can use them all over my app in different view controllers.

Has anyone been able to get this sort of approach to work or am I trying to fit a square block on a round hole?

I really don't like the idea of having to call methods like insertNewObjectForEntityForName multiple times in multiple places. I should be able to have a single object do it for me.
benbarnett is offline   Reply With Quote
Reply

Bookmarks

Tags
core data, design pattern, iphone

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 320
13 members and 307 guests
7twenty7, chiataytuday, condor304, Desert Diva, Domele, dre, dreamdash3, mottdog, oceanlablight, palme2elie, Paul Slocum, schmallegory
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,659
Threads: 94,118
Posts: 402,895
Top Poster: BrianSlick (7,990)
Welcome to our newest member, dreamdash3
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:16 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0