Re: core data app questions - help!
Re: core data app questions - help!
- Subject: Re: core data app questions - help!
- From: mmalc crawford <email@hidden>
- Date: Sat, 1 Sep 2007 23:39:11 -0700
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
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden