• 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
core data/binding question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

core data/binding question


  • Subject: core data/binding question
  • From: Warner Onstine <email@hidden>
  • Date: Sun, 23 Apr 2006 19:47:48 -0700

Hi all,
I'm currently working my way through "Learning Cocoa" and "Cocoa Programming" and have started building my own application. Please forgive as I'm primarily a Java web developer so most of this is brand new to me even though I started playing with NeXTSTEP back in the day.


I'll just go ahead and describe the application as simply as possible and what I have done so far to create it. I had done a Core Data app tutorial earlier and I thought that this would be the best way to do it so I went ahead and started the app out as a CoreData app.

This will be a replacement for my workout journal so I created one main screen that links to 4 sub-screens for different workout types - Weight, Strength, Cardio, and Yoga/Pilates. Each of these is setup through their own Nib file and loaded using an AppController with separate controllers for each screen (per Hillegass).

I then went ahead and created a number of Entities:
Workout - main entity that the other 4 inherit from
HeartRate - which is a relationship to the Workout Entity
ExerciseRoutine - which tracks sets/reps for strength and weight training
WeightTraining - inherits from Workout and has a one-to-many relationship of ExerciseRoutines (actually a subclass)
StrengthTraining - also inherits from Workout and has a one-to-many of ExerciseRoutines
CardioTraining - also inherits from Workout and has two extra text fields for other items


I went ahead and started with the Weight Training first. Following the Core Data tutorial on CocoaDev (http://cocoadevcentral.com/ articles/000085.php) I created WeightWorkouts NSArrayController. Initially I created this in the MainMenu.nib, then realized that I would need it in the WeightTraining.nib so I copied it over after I bound it to my delegate that XCode created for the CoreData stuff. Once I copied I checked the bindings and ran into my first issue - the delegate was no longer there so I did what seemed reasonable, I bound it to Shared Application and then the managedObjectContext for the model key path.

From there I'm kinda stuck. I have a table view that I was going to use to put in all the routines (routine, set, rep, weight), but I'm not sure how to bind the table to the sub-relationship data (which I assume would be some kind of array).

The next issue is how do the AppController and the AppDelegate work together? Or do I need to move some stuff from my AppController to the AppDelegate?

Thanks in advance, I was trying to choose something relatively simple for my first real Cocoa app, I'm hoping I didn't bite off too much.

If there are any threads that I should go through on the list those would be great as well.

-warner _______________________________________________
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: core data/binding question
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: How do I implement a splash window
  • Next by Date: Re: core data/binding question
  • Previous by thread: Re: Programmatically unarchiving files
  • Next by thread: Re: core data/binding question
  • Index(es):
    • Date
    • Thread