1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Core data importing entities

Discussion in 'Mac Programming' started by MacDonaldsd, Jul 29, 2007.

  1. macrumors 65816


    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 ?
  2. macrumors G4


    Do you mean that you want import an NSManagedObject from one model to another?

    Do you wish to copy related objects as well?
  3. macrumors 65816


    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.
  4. macrumors G4


    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.
  5. macrumors 65816


    So read it to a Normal object, then copy/create a NSManagedObject using code "behind the scenes" ?
  6. macrumors G4


    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.

Share This Page