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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.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 01-19-2010, 11:55 AM   #1 (permalink)
Registered Member
 
Join Date: Jan 2010
Location: Baton Rouge, LA
Posts: 131
Default CoreData TabBar Multiple ViewController that need persistentStoreCoordinator

I'm working on a CoreData app that has a tab bar, each item opens a ViewController that uses the coreData.. I have looked at the recipes app and its only got one TabBar Item/viewController that uses the CoreData so its a dead end for this question..

What is the proper way to set the persistentStoreCoordinator on the other views. Based on the recipes app, in you MainappDelegate you create the ViewController and set the persistentStoreCoordinator, then link this in the NIB to the TabBarItem's child navigation controller. So what if you have more than one tabbar that wants to use CoreData, do you create another outlet in the MainAppDelegate, and link it in the Nib to the next NavigationContoller/ViewContoller?

I know I sound like i just answered my own question but is this the right way to do this? I guess the whole linking and Nibs is just so silly to me.
Is there a way I can write some code to do this?
j3rm is offline   Reply With Quote
Old 01-26-2010, 11:10 AM   #2 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 32
Default

I just did something like this:

http://www.iphonedevsdk.com/forum/ip...ntext-nib.html

You don't need the persistent store, just the managedobjectcontext. You use that to access objects, create new ones and save. You declare on in the main app delegate, then when any other module needs to access it, it resolves the managedobjectcontext from the app delegate
odiggity is offline   Reply With Quote
Reply

Bookmarks

Tags
coredata, tab bar

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: 258
17 members and 241 guests
14DEV, @sandris, ADY, ArtieFufkin10, bookesp, ckgni, Dani77, DarkAn, HemiMG, iDifferent, jakerocheleau, JasonR, prchn4christ, Rudy, Speed, theone8one
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,767
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

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