Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 29, 2007, 04:51 AM   #1
MacDonaldsd
macrumors 65816
 
MacDonaldsd's Avatar
 
Join Date: Sep 2005
Location: London , UK
Core data importing entities

Im building an application that relies heavily on core data.

I was wondering if there is a way to import a single instance of a entity ?

Maybe by running a applescript or something ?
MacDonaldsd is offline   0 Reply With Quote
Old Jul 29, 2007, 01:07 PM   #2
Eraserhead
macrumors G4
 
Eraserhead's Avatar
 
Join Date: Nov 2005
Location: UK
Do you mean that you want import an NSManagedObject from one model to another?

Do you wish to copy related objects as well?
Eraserhead is offline   0 Reply With Quote
Old Jul 30, 2007, 06:42 AM   #3
MacDonaldsd
Thread Starter
macrumors 65816
 
MacDonaldsd's Avatar
 
Join Date: Sep 2005
Location: London , UK
Basically Im doing a timetable application. So modules that are related to assessments is what im referring to here.

I would like to be able to just import assessment details. So a user can just import the details rather than typing them manually as everyone will have the same information.
MacDonaldsd is offline   0 Reply With Quote
Old Jul 30, 2007, 08:56 AM   #4
Eraserhead
macrumors G4
 
Eraserhead's Avatar
 
Join Date: Nov 2005
Location: UK
So you want to import the assessment information from another file into your Core Data model for your application?

In which case you'll need to read in the data using a normal (non Core Data) Cocoa data input system and then attach the data to the relevant NSManagedObject.
Eraserhead is offline   0 Reply With Quote
Old Jul 30, 2007, 11:56 AM   #5
MacDonaldsd
Thread Starter
macrumors 65816
 
MacDonaldsd's Avatar
 
Join Date: Sep 2005
Location: London , UK
Quote:
Originally Posted by Eraserhead View Post
So you want to import the assessment information from another file into your Core Data model for your application?

In which case you'll need to read in the data using a normal (non Core Data) Cocoa data input system and then attach the data to the relevant NSManagedObject.
So read it to a Normal object, then copy/create a NSManagedObject using code "behind the scenes" ?
MacDonaldsd is offline   0 Reply With Quote
Old Jul 30, 2007, 12:17 PM   #6
Eraserhead
macrumors G4
 
Eraserhead's Avatar
 
Join Date: Nov 2005
Location: UK
Pretty much but you may not need to read it into a normal object at all as you may be able to read it as an int, double, BOOL, NSString etc. and then attach it directly to the NSManagedObject you wish to store the data in.

However you have the basic idea.
Eraserhead is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
core data binding not working Javajax Mac Programming 3 Jul 10, 2011 01:23 PM
Resolved: Struggling with Core Data: Part 2 RonC iPhone/iPad Programming 2 May 27, 2011 01:02 PM
How do I count the number of child entities with a specific value? Mr Skills iPhone/iPad Programming 2 Apr 8, 2011 03:49 PM
Help Needed - Xcode 4 Options: Use Core Data Include Unit Tests Mitch1984 iPhone/iPad Programming 3 Feb 26, 2011 03:42 PM
Core Data type entity best practice? GorillaPaws Mac Programming 0 Dec 5, 2009 01:47 PM


All times are GMT -5. The time now is 12:34 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC