Ok bit of a newbie type question.
I want to use Core Data, together with Tab and Navigation controllers.
In XCode if I create a Navigation Based Application I get the option to choose Core Data. Whereas If I create a Tab Bar Application I don't get the choice.
I understand that Tab Bars display view controllers so it kinda makes sense. However given that by default it sticks the basic Core Data code in the Application delegate I don't see why this isn't offered.
At the moment I'm creating the two projects and cutting and pasting between them.
Does this omission in XCode seem weird to you? Is it some sort of oversight?
Thanks, Matt
I've faced the same problem and ended up creating a tabBar app and adding the core data stuff later.
To do so, I've:
This should get you to the same point you would be at with the core data supporting templates.
For your specific case (core data with tabbar), Apple have a good sample app:
http://developer.apple.com/iphone/library/samplecode/iPhoneCoreDataRecipes/index.html
This shows how they pass the context through to the relevant view controller defined in the xib file which was the thing that held me up for a while.
Hope this helps.
Cheers, Peter
You can add it yourself it's very simple to do:
To modify Tab Bar template settings you have to open the following file
For XCode 4.2:
/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/Project Templates/Application/Tabbed Application.xctemplate/TemplateInfo.plist
To add core data option you have to add the property "com.apple.dt.unit.coreDataCocoaTouchApplication
" to the Ancestors key:
after adding the property it should look like this:
<key>Ancestors</key>
<array>
<string>com.apple.dt.unit.storyboardApplication</string>
<string>com.apple.dt.unit.coreDataCocoaTouchApplication</string>
</array>
For Previous XCode Versions
/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/Project Templates/Application/Tab Bar Application.xctemplate/TemplateInfo.plist
To add core data option you have to add the property "com.apple.dt.unit.coreDataCocoaTouchApplication
" to the Ancestors key:
after adding the property it should look like this:
<key>Ancestors</key>
<array>
<string>com.apple.dt.unit.cocoaTouchFamiliedApplication</string>
<string>com.apple.dt.unit.coreDataCocoaTouchApplication</string>
</array>
Restart the Xcode!
Everything should work fine now:!! And you have Core Data option visible when you Create a new Tabbed Project In Xcode.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With