core data app questions - help!

  • Hi all, I'm new to cocoa programming, having written a lot of c++
    programs, mostly computational fluid dynamics and heat transfer
    simulations.  I've recently been delving into writing a core data
    app, there are a couple of things that I'm really struggling to
    figure out.

    First I ought to describe my project a bit - I'm making a
    (relatively) simple workout log.  I have three entities:  workout,
    sport and intensity.  each workout has a date, a duration, a
    distance, and a note, and also a relationship to a sport and an
    intensity.  My main interface window has a table with a list of
    workouts (with add/delete buttons) that I've logged, a table of
    sports, a table of intensities and a calendar.  I have similar
    secondary windows for my sports and intensities, where I will add/
    delete sports or intensities.  There are a couple of things I would
    like to do with my main interface window.

    1.  I would like to be able to click on a date on the calendar
    (currently doesn't have any function) and have only the workout(s)
    from that day show in the table.

    2.  I would like to be able to click on a sport in the sport table on
    in the main window (currently just a listing of the sports that I've
    added on the sports window) and have only the workout(s) with that
    sport associated with them show in the table.

    3.  I'd like to have the same functionality with the intensity table
    in the main window.  I'd also like to be able to filter by both sport
    and intensity, so if I click on a sport and then click on an
    intensity it shows me only the workouts associated with that sport
    and intensity.

    4.  computations:  I'd like to have a text box which shows me the
    total of the duration column.  If I filter the table by sport or
    intensity I'd like this box to show the filtered total.  If I can
    also show a weekly and monthly total that would be awesome.  It would
    also be awesome if I could add a column to my workout table that
    automatically calculated average pace (workout distance/workout time).

    Those are the 4 items on my wish list.  Please let me know if you
    have any advice/suggestions/places for me to read up on these
    topics.  I hope to hear from you again.  thanks!!
    jacob
    jacob [dot] scheckman [at] gmail [dot] com
    jakescheck [dot] blogspot [dot] com
  • On Aug 31, 2007, at 9:02 PM, Jacob Scheckman wrote:

    > Hi all, I'm new to cocoa programming, having written a lot of c++
    > programs, mostly computational fluid dynamics and heat transfer
    > simulations.  I've recently been delving into writing a core data
    > app, there are a couple of things that I'm really struggling to
    > figure out.
    >
    Many of these issues have little to do directly with Core Data.
    I would strongly suggest reading <http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles
    /cdBeforeYouStart.html
    > then spending a week or two trying smaller projects focusing on
    learning the fundamental design patterns and techniques that pervade
    Cocoa (see in particular <http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals
    /index.html
    >) before complicating matters with Core Data.

    mmalc
  • Hola Jacob!

    > Date: Fri, 31 Aug 2007 23:02:56 -0500
    > From: Jacob Scheckman <jacob.scheckman...>
    > Subject: core data app questions - help!
    > To: <cocoa-dev...>
    > Message-ID: <5F8C9330-6ED9-4D8B-82B0-D9750E292F57...>
    > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
    >

    Your wish list will need some work from you —not all of this is given
    "by free" in Core Data.
    But the main thing to have in mind is that if you have a good model,
    you can fetch (see) your data in many ways, just by free. Also, you
    may have to adjust your interface to.

    As I understand, your model is something like W<<-->S : W<<-->I (with
    the obvious meanings).

    The easiest part is to put at work your to-many relations: any of the
    tutorials that come with the tools will explain (in particular, see
    http://developer.apple.com/cocoa/coredatatutorial/index.html )

    For number one, I would recommend to add an entity with dates, and
    with relations W<<-->D, so by clicking in a date you can see only
    those objects in W with that date... if this can be done with a nicer
    interface (a calendar) will be your research – please let us know ;^)

    For the last, you will have to implement a notification centre that
    advise you whenever the table changes, so you can calculate the
    needed sum using something like [[table displayedObjects] @sum
    (duration)].
    There is no magic in this... as far as I know, but if you find a
    shortcut, also let us know!

    >
    > 1.  I would like to be able to click on a date on the calendar
    > (currently doesn't have any function) and have only the workout(s)
    > from that day show in the table.
    >
    > 2.  I would like to be able to click on a sport in the sport table on
    > in the main window (currently just a listing of the sports that I've
    > added on the sports window) and have only the workout(s) with that
    > sport associated with them show in the table.
    >
    > 3.  I'd like to have the same functionality with the intensity table
    > in the main window.  I'd also like to be able to filter by both sport
    > and intensity, so if I click on a sport and then click on an
    > intensity it shows me only the workouts associated with that sport
    > and intensity.
    >
    > 4.  computations:  I'd like to have a text box which shows me the
    > total of the duration column.  If I filter the table by sport or
    > intensity I'd like this box to show the filtered total.  If I can
    > also show a weekly and monthly total that would be awesome.  It would
    > also be awesome if I could add a column to my workout table that
    > automatically calculated average pace (workout distance/workout time).

    Suerte!
    Dino
  • On Sep 1, 2007, at 9:57 AM, Ricardo Strausz wrote:
    > But the main thing to have in mind is that if you have a good model,
    > you can fetch (see) your data in many ways, just by free.
    >
    This us at best misleading; fetches in general are *not* free -- a
    fetch causes Core Data to go back to the persistent store, which is an
    expensive operation.
    You can certainly fetch your data in many ways, but constructing the
    correct fetch request is itself not always conceptually free (i.e. you
    have to think about it).

    > Also, you may have to adjust your interface to.
    >
    Well, yes...

    > As I understand, your model is something like W<<-->S : W<<-->I
    > (with the obvious meanings).
    > The easiest part is to put at work your to-many relations: any of
    > the tutorials that come with the tools will explain (in particular,
    > see http://developer.apple.com/cocoa/coredatatutorial/index.html )
    >
    This explains how to create a "default" interface using bindings.
    Like Core Data, bindings are not a beginner technology.

    If you're able to create your application solely using drag-and-drop/
    point-and-click technologies, then fine.  But typically there's more
    to it than that and if you don't understand the fundamentals on which
    those technologies are based then you're left several levels of
    abstraction up in the air with no idea how to progress...

    > For number one, I would recommend to add an entity with dates, and
    > with relations W<<-->D, so by clicking in a date you can see only
    > those objects in W with that date... if this can be done with a
    > nicer interface (a calendar) will be your research – please let us
    > know ;^)
    >
    It's not clear exactly what this means or how it helps.

    > For the last, you will have to implement a notification centre that
    > advise you whenever the table changes, so you can calculate the
    > needed sum using something like [[table displayedObjects]
    > @sum(duration)].
    >
    Again this is at best misleading -- the precise mechanism used to
    propagate change notifications will depend on the application
    architecture implemented.  Moreover, there is no 'displayedObjects'
    method, and you cannot send a @sum(duration) message.  *If* you're
    using bindings, then you might *bind* the 'value' of a text field to
    the sum of duration properties of the *arrangedObjects* in a relevant
    array controller.

    mmalc
  • Hola mmalc!

    On Sep 1, 2007, at 5:41 PM, mmalc crawford wrote:

    >
    > On Sep 1, 2007, at 9:57 AM, Ricardo Strausz wrote:
    >> But the main thing to have in mind is that if you have a good
    >> model, you can fetch (see) your data in many ways, just by free.
    >>
    > This us at best misleading; fetches in general are *not* free -- a
    > fetch causes Core Data to go back to the persistent store, which is
    > an expensive operation.
    > You can certainly fetch your data in many ways, but constructing
    > the correct fetch request is itself not always conceptually free
    > (i.e. you have to think about it).

    While I was writing that, I was thinking in the following scenario:
    1. it is a small app
    2. it is using SQLite as persistence
    3. the S-->>W relation gives me a "free" fetch of Ws, just by
    clicking in the S table view

    >
    >> Also, you may have to adjust your interface to.
    >>
    > Well, yes...

    ;^)

    >
    >
    >> As I understand, your model is something like W<<-->S : W<<-->I
    >> (with the obvious meanings).
    >> The easiest part is to put at work your to-many relations: any of
    >> the tutorials that come with the tools will explain (in
    >> particular, see http://developer.apple.com/cocoa/coredatatutorial/
    >> index.html )
    >>
    > This explains how to create a "default" interface using bindings.
    > Like Core Data, bindings are not a beginner technology.

    It is not that difficult —and hopefully it is understandable to
    someone doing differential equations in C++ (right Jacob?)

    >
    > If you're able to create your application solely using drag-and-
    > drop/point-and-click technologies, then fine.  But typically
    > there's more to it than that and if you don't understand the
    > fundamentals on which those technologies are based then you're left
    > several levels of abstraction up in the air with no idea how to
    > progress...

    Only experience will drag you deeper in the Framework...

    >
    >> For number one, I would recommend to add an entity with dates, and
    >> with relations W<<-->D, so by clicking in a date you can see only
    >> those objects in W with that date... if this can be done with a
    >> nicer interface (a calendar) will be your research – please let us
    >> know ;^)
    >>
    > It's not clear exactly what this means or how it helps.

    It is just an idea of how implement the "free" fetch described below.
    If whenever you insert a new W, you also insert a new D —with its
    proper relation— you can bring back your Ws by clicking in the
    appropriate D...

    Adding some extra code, the contents of D can be showed in a more
    "fashionable" way...

    >
    >
    >> For the last, you will have to implement a notification centre
    >> that advise you whenever the table changes, so you can calculate
    >> the needed sum using something like [[table displayedObjects] @sum
    >> (duration)].
    >>
    > Again this is at best misleading -- the precise mechanism used to
    > propagate change notifications will depend on the application
    > architecture implemented.  Moreover, there is no 'displayedObjects'
    > method, and you cannot send a @sum(duration) message.  *If* you're
    > using bindings, then you might *bind* the 'value' of a text field
    > to the sum of duration properties of the *arrangedObjects* in a
    > relevant array controller.

    mmalc, mmalc... of course this was not meant to be taken literally...
    I meant to construct an array of the displayed objects and, via KVC —
    or with a classic loop if you will— calculate the desired sum; I
    wanted to emphasise that some code should be written (because I was
    not sure that such a deviated value can be binded).

    BTW, there may be a good delegate method which allows to run such a
    code on-time... can't remember now :-(

    HIH

    Dino

    >
    > mmalc
  • On Sep 1, 2007, at 4:49 PM, Ricardo Strausz wrote:
    >>> As I understand, your model is something like W<<-->S : W<<-->I
    >>> (with the obvious meanings).
    >>> The easiest part is to put at work your to-many relations: any of
    >>> the tutorials that come with the tools will explain (in
    >>> particular, see http://developer.apple.com/cocoa/coredatatutorial/index.html
    >>> )
    >> This explains how to create a "default" interface using bindings.
    >> Like Core Data, bindings are not a beginner technology.
    > It is not that difficult —and hopefully it is understandable to
    > someone doing differential equations in C++ (right Jacob?)
    >
    Whether or not one is an expert in "doing differential equations in C+
    +" is irrelevant.  We see week in and week out people who are
    perfectly proficient in other aspects of programming struggling with
    bindings and Core Data and in particular the combination thereof
    because they haven't yet mastered the fundamental idioms of Cocoa...

    >> If you're able to create your application solely using drag-and-
    >> drop/point-and-click technologies, then fine.  But typically
    >> there's more to it than that and if you don't understand the
    >> fundamentals on which those technologies are based then you're left
    >> several levels of abstraction up in the air with no idea how to
    >> progress...
    > Only experience will drag you deeper in the Framework...
    >
    ... indeed, however diving in too deep at the outset, again as we see
    week after week, typically means you drown.

    >>> For number one, I would recommend to add an entity with dates, and
    >>> with relations W<<-->D, so by clicking in a date you can see only
    >>> those objects in W with that date... if this can be done with a
    >>> nicer interface (a calendar) will be your research – please let us
    >>> know ;^)
    >> It's not clear exactly what this means or how it helps.
    > It is just an idea of how implement the "free" fetch described
    > below. If whenever you insert a new W, you also insert a new D —
    >
    If you want to do that, then you need more than bindings -- you need
    code.

    > with its proper relation— you can bring back your Ws by clicking in
    > the appropriate D...
    >
    And typically you shouldn't think traversing relationships in terms of
    fetching.  You need to be aware of the fact that a fetch may be
    involved (see "pre-fetching") but following relationships should be
    thought of as just that.

    >>> For the last, you will have to implement a notification centre
    >>> that advise you whenever the table changes, so you can calculate
    >>> the needed sum using something like [[table displayedObjects]
    >>> @sum(duration)].
    >>>
    >> Again this is at best misleading -- the precise mechanism used to
    >> propagate change notifications will depend on the application
    >> architecture implemented.  Moreover, there is no 'displayedObjects'
    >> method, and you cannot send a @sum(duration) message.  *If* you're
    >> using bindings, then you might *bind* the 'value' of a text field
    >> to the sum of duration properties of the *arrangedObjects* in a
    >> relevant array controller.
    >
    > of course this was not meant to be taken literally...
    >
    That was not at all clear.  And certainly it would not be to many
    beginners.

    > I meant to construct an array of the displayed objects and, via KVC —
    > or with a classic loop if you will— calculate the desired sum; I
    > wanted to emphasise that some code should be written (because I was
    > not sure that such a deviated value can be binded).
    >
    It is quite possible that an aggregate value may be shown solely using
    bindings.  But your example is simply ambiguous and, as noted, at best
    misleading.

    > BTW, there may be a good delegate method which allows to run such a
    > code on-time... can't remember now :-(
    >
    Again not particularly helpful...

    mmalc
  • > On Sep 2, 2007, at 1:39 AM, mmalc crawford wrote:
    >
    >> On Sep 1, 2007, at 4:49 PM, Ricardo Strausz wrote:
    >>
    >> BTW, there may be a good delegate method which allows to run such
    >> a code on-time... can't remember now :-(
    >>
    > Again not particularly helpful...

    I really do not see your point; are you trying to show (me et al.)
    that you (think to) have more experience, or you are trying to help
    Jacob?!?

    I simply do not see any helpful comment in your replay...

    Dino

    >
    > mmalc
    >
  • On Sep 2, 2007, at 12:04 PM, Ricardo Strausz wrote:

    >>> BTW, there may be a good delegate method which allows to run such
    >>> a code on-time... can't remember now :-(
    >>>
    >> Again not particularly helpful...
    >
    > I really do not see your point; are you trying to show (me et al.)
    > that you (think to) have more experience, or you are trying to help
    > Jacob?!?
    >
    > I simply do not see any helpful comment in your replay...
    >

      From a third-party perspective, mmalc's comments are spot-on. The
    unhelpfulness is to do more with the fact that you say there's
    "something somewhere" that can help the OP but you can't recall what
    or where. If you can't, just leave it out, rather than send someone on
    a possible fool's errand to locate this mysterious and fabled help. :-)

    --
    I.S.
  • On Sep 2, 2007, at 12:20 PM, I. Savant wrote:

    > The unhelpfulness is to do more with the fact that you say there's
    > "something somewhere" that can help the OP but you can't recall
    > what or where. If you can't, just leave it out, rather than send
    > someone on a possible fool's errand to locate this mysterious and
    > fabled help. :-)

    De-lurking...

    The same content rephrased would have been helpful:

    "There may be a good delegate method but I can't remember it.  Could
    someone chime in with an idea?"

    It implies that you know your help isn't up to the task and commands
    attention from the rest of the list.

    That said, my whole email is useless noise on this topic.

    Steve Kirks
    http://houseofwarwick.com/
    <warwick...>
    AIM/iChat: <srk...>
  • Hola tod@s!

    as we say in Mexico, "la ultima y nos vamos"...

    On Sep 2, 2007, at 12:20 PM, I. Savant wrote:

    > On Sep 2, 2007, at 12:04 PM, Ricardo Strausz wrote:
    >
    >>>> BTW, there may be a good delegate method which allows to run
    >>>> such a code on-time... can't remember now :-(
    >>>>
    >>> Again not particularly helpful...
    >>
    >> I really do not see your point; are you trying to show (me et al.)
    >> that you (think to) have more experience, or you are trying to
    >> help Jacob?!?
    >>
    >> I simply do not see any helpful comment in your replay...
    >>
    >
    > From a third-party perspective, mmalc's comments are spot-on. The
    > unhelpfulness is to do more with the fact that you say there's
    > "something somewhere" that can help the OP but you can't recall
    > what or where. If you can't, just leave it out, rather than send
    > someone on a possible fool's errand to locate this mysterious and
    > fabled help. :-)

    First of all, this is "out-of-context"... as mmalc understood (I
    hope) I refer to the hole replay, not only this last line, but any
    how...

    If I write "there may be a delegate method..." is because it is much
    easier to find relevant info with this hint, even by googleing
    "delegate method table view" instead of simply "NSTableView"... try:

    http://www.google.com/search?hl=en&client=safari&rls=en&q=deleg
    ate

    +methods+table+view&btnG=Search

    http://www.google.com/search?
    hl=en&client=safari&rls=en&q=NSTableView&btnG=Search

    The first one will point you almost directly to a guide of delegate
    methods of the NSTableView class...

    IMHO: for me, at least, this is better than nothing... I would like
    to know Jacob's opinion...

    Dino

    BTW, Jacob: I'd implement such "sum and average" algorithms in the
    delegate method tableViewSelectionDidChange: Then your user will be
    able, also, to drag-select some rows and calculate the sum and
    average for those selected records.

    >
    > --
    > I.S.
    >

    --
    Ricardo Strausz
    Business Applied C Objects
    dinos[@]mac.com
    http://homepage.mac.com/strausz/baco
    (+52-55) 5437-8205
  • On Sep 3, 2007, at 1:13 PM, Ricardo Strausz wrote:

    > First of all, this is "out-of-context"... as mmalc understood (I
    > hope) I refer to the hole replay, not only this last line, but any
    > how...
    >
      It really wasn't out of context at all. Unless there are more off-
    list messages to this thread that I've not seen, anyway.


      That's easily debated. Too much indirect, unspecific information is
    confusing. My gripe was that you essentially sent a picture of a guy
    swinging a hammer and labeled it "How to Build a House". ;-)

      A delegate method does exist for being notified of a change in
    selection for a table view, but it's still got little to do directly
    with the original problem. Sending the OP to a list of delegate
    methods (implementing one of which addresses only a small part of one
    of his problems) is unhelpful at best.

    > BTW, Jacob: I'd implement such "sum and average" algorithms in the
    > delegate method tableViewSelectionDidChange: Then your user will be
    > able, also, to drag-select some rows and calculate the sum and
    > average for those selected records.

      Okay, I've whined enough and it's time to put my money where my
    mouth is.

      First, this approach is overkill if you're already using bindings.
    As mmalc alluded, you can use Key Value Coding "Set and Array
    Operators" to solve this problem via bindings:

    http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Co
    ncepts/ArrayOperators.html


      This is far easier than responding to a selection change on the
    table view and running calculations (and manually updating UI) there.
    How 2004! :-)

      On to the rest ...

    > 1.  I would like to be able to click on a date on the calendar
    > (currently doesn't have any function) and have only the workout(s)
    > from that day show in the table.
    >

      For the view layer (UI), look up "NSDatePicker". You can configure
    it to use a visual calendar view or a text field with appropriate
    spinners.

      I'm not sure how exactly you'd want to handle this, but with Core
    Data, you will need to "ask the right question" when the date is chosen.

      See this document for the use of predicates:

    http://developer.apple.com/documentation/Cocoa/Conceptual/Predicates/index.
    html


      I'm not sure (mmalc?) whether "give me anything on this 'day'"
    needs to be translated to "give me anything from 00:00:00 on this day
    to 23:59:59 on this same day" or not, but keep that in mind.

      These are the things of which you must be aware, anyhow. If you get
    stuck, you know where to ask ... ;-)

    > 2.  I would like to be able to click on a sport in the sport table on
    > in the main window (currently just a listing of the sports that I've
    > added on the sports window) and have only the workout(s) with that
    > sport associated with them show in the table.
    >
    >
    > 3.  I'd like to have the same functionality with the intensity table
    > in the main window.  I'd also like to be able to filter by both sport
    > and intensity, so if I click on a sport and then click on an
    > intensity it shows me only the workouts associated with that sport
    > and intensity.
    >
      Again, predicates. You'll probably want to use the selection from
    your Sport and Intensity array controllers (the same ones to which
    your table views are bound) to build a compound predicate for your
    Workout array controller. This will list only "workouts whose sport is
    { list of included sports } and whose intensity is { list of included
    intensities }".

      The devil, as they say, is in the details (and there are probably
    more than a few in this setup) but you get the general idea.

    >
    > 4.  computations:  I'd like to have a text box which shows me the
    > total of the duration column.  If I filter the table by sport or
    > intensity I'd like this box to show the filtered total.  If I can
    > also show a weekly and monthly total that would be awesome.  It would
    > also be awesome if I could add a column to my workout table that
    > automatically calculated average pace (workout distance/workout time).
    >

      This was answered above, but to reiterate:

    http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Co
    ncepts/ArrayOperators.html


      It is automatic and pseudo-magical. It's also the easiest and most-
    immediately-complete solution to this wish-list item.

    --
    I.S.
  • Now, this *is* helpful...
    I am sure that Jacob will appreciate these words more than any before
    in this thread...

    On Sep 3, 2007, at 4:50 PM, I. Savant wrote:

    >
    > On Sep 3, 2007, at 1:13 PM, Ricardo Strausz wrote:
    >
    >> First of all, this is "out-of-context"... as mmalc understood (I
    >> hope) I refer to the hole replay, not only this last line, but any
    >> how...
    >>
    > It really wasn't out of context at all. Unless there are more off-
    > list messages to this thread that I've not seen, anyway.
    >
    >> http://www.google.com/search?hl=en&client=safari&rls=en&q=deleg
    ate

    >> +methods+table+view&btnG=Search
    >>
    >> http://www.google.com/search?
    >> hl=en&client=safari&rls=en&q=NSTableView&btnG=Search
    >>
    >> IMHO: for me, at least, this is better than nothing...
    >
    > That's easily debated. Too much indirect, unspecific information
    > is confusing. My gripe was that you essentially sent a picture of a
    > guy swinging a hammer and labeled it "How to Build a House". ;-)
    >
    > A delegate method does exist for being notified of a change in
    > selection for a table view, but it's still got little to do
    > directly with the original problem. Sending the OP to a list of
    > delegate methods (implementing one of which addresses only a small
    > part of one of his problems) is unhelpful at best.
    >
    >> BTW, Jacob: I'd implement such "sum and average" algorithms in the
    >> delegate method tableViewSelectionDidChange: Then your user will
    >> be able, also, to drag-select some rows and calculate the sum and
    >> average for those selected records.
    >
    > Okay, I've whined enough and it's time to put my money where my
    > mouth is.
    >
    > First, this approach is overkill if you're already using
    > bindings. As mmalc alluded, you can use Key Value Coding "Set and
    > Array Operators" to solve this problem via bindings:
    >
    > http://developer.apple.com/documentation/Cocoa/Conceptual/
    > KeyValueCoding/Concepts/ArrayOperators.html
    >
    > This is far easier than responding to a selection change on the
    > table view and running calculations (and manually updating UI)
    > there. How 2004! :-)
    >
    > On to the rest ...
    >
    >> 1.  I would like to be able to click on a date on the calendar
    >> (currently doesn't have any function) and have only the workout(s)
    >> from that day show in the table.
    >>
    >
    > For the view layer (UI), look up "NSDatePicker". You can
    > configure it to use a visual calendar view or a text field with
    > appropriate spinners.
    >
    > I'm not sure how exactly you'd want to handle this, but with Core
    > Data, you will need to "ask the right question" when the date is
    > chosen.
    >
    > See this document for the use of predicates:
    >
    > http://developer.apple.com/documentation/Cocoa/Conceptual/
    > Predicates/index.html
    >
    > I'm not sure (mmalc?) whether "give me anything on this 'day'"
    > needs to be translated to "give me anything from 00:00:00 on this
    > day to 23:59:59 on this same day" or not, but keep that in mind.
    >
    > These are the things of which you must be aware, anyhow. If you
    > get stuck, you know where to ask ... ;-)
    >
    >> 2.  I would like to be able to click on a sport in the sport table on
    >> in the main window (currently just a listing of the sports that I've
    >> added on the sports window) and have only the workout(s) with that
    >> sport associated with them show in the table.
    >>
    >>
    >> 3.  I'd like to have the same functionality with the intensity table
    >> in the main window.  I'd also like to be able to filter by both sport
    >> and intensity, so if I click on a sport and then click on an
    >> intensity it shows me only the workouts associated with that sport
    >> and intensity.
    >>
    > Again, predicates. You'll probably want to use the selection from
    > your Sport and Intensity array controllers (the same ones to which
    > your table views are bound) to build a compound predicate for your
    > Workout array controller. This will list only "workouts whose sport
    > is { list of included sports } and whose intensity is { list of
    > included intensities }".
    >
    > The devil, as they say, is in the details (and there are probably
    > more than a few in this setup) but you get the general idea.
    >
    >>
    >> 4.  computations:  I'd like to have a text box which shows me the
    >> total of the duration column.  If I filter the table by sport or
    >> intensity I'd like this box to show the filtered total.  If I can
    >> also show a weekly and monthly total that would be awesome.  It would
    >> also be awesome if I could add a column to my workout table that
    >> automatically calculated average pace (workout distance/workout
    >> time).
    >>
    >
    > This was answered above, but to reiterate:
    >
    > http://developer.apple.com/documentation/Cocoa/Conceptual/
    > KeyValueCoding/Concepts/ArrayOperators.html
    >
    > It is automatic and pseudo-magical. It's also the easiest and
    > most-immediately-complete solution to this wish-list item.
    >
    > --
    > I.S.
    >
    >
    >
previous month september 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Go to today