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 11-19-2011, 05:56 PM   #1 (permalink)
Registered Member
 
Join Date: Nov 2011
Posts: 45
alextattoo is on a distinguished road
Default How to add core data to 2nd level view controller in existing project

Hi , i have a table view with couple of rows and each row open a new detail view with keypad panel for user input. So i want to save that input (2-3 digits number) ,but don't know how to add core data to my second view (detail) controller.Any ideas?
alextattoo is offline   Reply With Quote
Old 11-19-2011, 06:08 PM   #2 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by alextattoo View Post
Hi , i have a table view with couple of rows and each row open a new detail view with keypad panel for user input. So i want to save that input (2-3 digits number) ,but don't know how to add core data to my second view (detail) controller.Any ideas?
When you're first starting out with with Core Data, use one of the project templates that includes Core Data support. There's a whole bunch of stuff you need to learn how to do, and trying to add it to an existing project after the fact is difficult and involved.

I've done several Core Data based applications, and I don't think I could list all the housekeeping you have to do to set it up. I'd have to go digging. In fact, I'd probably create an empty Core Data template app and look at what's there.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is online now   Reply With Quote
Old 11-20-2011, 02:19 AM   #3 (permalink)
Registered Member
 
SundialSoft's Avatar
 
Join Date: Oct 2010
Location: Scotland
Posts: 176
SundialSoft is on a distinguished road
Default

Quote:
Originally Posted by alextattoo View Post
Hi , i have a table view with couple of rows and each row open a new detail view with keypad panel for user input. So i want to save that input (2-3 digits number) ,but don't know how to add core data to my second view (detail) controller.Any ideas?
Assuming you are registered as a developer with Apple you can download a number of core data samples eg: core data books. Possibly you want a simpler example to start with. You will find lots by googling but make sure the database structure is correct before you start using any core data setup in your app.

In Xcode 4.2 it's not obvious how to get a core data project. Choose master-detail project for example, tick 'use core data' and untick storyboard if you are not using that approach. Same goes for ARC. Untick if you want to use the older way of working with retain release.

Once you have a blank project look at the files. You will see 'projectname'.xcdatamodeld. Click on this and then you are at the start of learning core data. Add your fields & use Editor, create NSManagedObject subclass to create the XCode files to manage the data.
SundialSoft is offline   Reply With Quote
Old 11-20-2011, 02:55 AM   #4 (permalink)
Registered Member
 
Join Date: Nov 2011
Posts: 45
alextattoo is on a distinguished road
Default

Quote:
Originally Posted by SundialSoft View Post
Assuming you are registered as a developer with Apple you can download a number of core data samples eg: core data books. Possibly you want a simpler example to start with. You will find lots by googling but make sure the database structure is correct before you start using any core data setup in your app.

In Xcode 4.2 it's not obvious how to get a core data project. Choose master-detail project for example, tick 'use core data' and untick storyboard if you are not using that approach. Same goes for ARC. Untick if you want to use the older way of working with retain release.

Once you have a blank project look at the files. You will see 'projectname'.xcdatamodeld. Click on this and then you are at the start of learning core data. Add your fields & use Editor, create NSManagedObject subclass to create the XCode files to manage the data.
I already have a working core data project all i want is to add it to another project i have to store the inputs

Last edited by alextattoo; 11-20-2011 at 03:15 AM.
alextattoo is offline   Reply With Quote
Reply

Bookmarks

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: 379
18 members and 361 guests
7twenty7, Alex-alex, Apptronics RBC, baja_yu, chiataytuday, Clouds, dedeys78, dre, Duncan C, e2applets, ipodphone, jeroenkeij, leostc, matador1978, mbadegree, QuantumDoja, Retouchable, usernametaken
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,125
Posts: 402,910
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

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