• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Newbie Help understanding Core Data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Newbie Help understanding Core Data


  • Subject: Newbie Help understanding Core Data
  • From: Vince Ackerman <email@hidden>
  • Date: Wed, 27 Jul 2005 12:24:09 -0700

A long long time ago, prior to losing all my brain cells associated with programming, and prior to entering the Cocoa world, I wrote an app in C, for scheduling travel itineraries . I've been tempted to rewrite it in Obj C but am such a newbie it seems daunting, to say the very least. ( WARNING I only know enough to be dangerous. I'm an old guy, maybe too old).

Basically the app is a database of 100's of schedules. A calendar showing days you travel, each city and leg flown, arrival and departure times, hotel info and other stuff. I originally wrote it using structs in C. So I'm wondering if I can convert them to Core data entities? There would be a array of different calendars, each having different trips on certain days of the month, to various cities. Each calendar Day would either be a day off or a day on the trip or regular work day. Each trip would be a separate entity, and have one or more days with one or more legs between cities. I'd want to be able to sort for schedules that have certain trips to certain cities, or trips that have the highest per diem, or calenders that have certain days off. etc.

Playing with the object graph, I've created entities with attributes and relationships and I have come up with this:

Array of Calendars --> Calendar --> Each Day --> Trip/Off --> travel legs that day

Each Calendar is a separate entity, composed of attributes of month pay, total pre diem, etc and to-many relationships with Day entities?

Each Day is a separate entity, composed of attributes of what type of day (day off or work or travel) with a to-one relationship to a specific trip.

Each trip is a separate entity composed of attributes such as pay for trip, per diem, and a to-many relationship of multiple leg entities?

Each leg is a separate entity, composed of various attributes such as dep and arriv times, travel times, cities, hotel, phone, etc. and this has an inverse relationship to a specific trip.

I would load the data for each trip and each calendar by parsing a text file, not by a GUI interface, so I'm not sure how to go about all of this vis a vis controllers, etc. Seems like I'd have to have a controller for each type of entity. I'm tempted to just use arrays of dictionaries for the legs and trips, and the calendar would have an array of dictionaries for the days, and skip core data. After reading all the docs I'm still as confused as before. Most of the docs assume you are going to use the gui to load data, and I want to do it programatically, creating first the trip entities linked with multiple legs, etc. Then create the Calendars linked to specific trip entities. Where can I find sample code on doing this programatically?

Is this project do-able with Core Data? Can anyone give me some newbie-level pointers?

Thanks

Vince Ackerman
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Newbie Help understanding Core Data
      • From: Charilaos Skiadas <email@hidden>
  • Prev by Date: Re: Cocoa-dev Digest, Vol 2, Issue 1149
  • Next by Date: Re: [ANN] bindlist.py: A simple tool for listing all the bindings in a nib
  • Previous by thread: RE: Accessing instance method in nib
  • Next by thread: Re: Newbie Help understanding Core Data
  • Index(es):
    • Date
    • Thread