Re: Composite values using Core Data and Cocoa Bindings
Re: Composite values using Core Data and Cocoa Bindings
- Subject: Re: Composite values using Core Data and Cocoa Bindings
- From: "Marcus S. Zarra" <email@hidden>
- Date: Wed, 27 Jul 2005 09:48:23 -0600
I would create a subclass of NSManagedObject for the object in question.
Then create an accessor method that does the calculation for you. Then you
can link the NSTextField to that accessor method.
To get this to auto update you need to [self exposeBinding:] in the
initialize method of the new NSManagedObject subclass and then set it to
trigger on the other values it calculates off of.
It sounds daunting but really is not that hard after you have done it a
couple of times.
Marcus
On 7/26/05, Andy Shamel <email@hidden> wrote:
>
> I'm having a heck of a time figuring out how to get a value into an
> NSTextField that is the sum or product of two or more attributes in
> separate entities. For example, I have a character entity with
> several ability scores as Int 16 attributes. Each of these scores can
> be modified by a number of other entities. How do I make the
> NSTextField display the sum of the original score, plus any modifiers?
>
> I have a feeling I will be delving into modifying the accessor methods
> of the Character entity's subclass of NSManagedObject, but i'm not
> sure, and am frankly unsure how to proceed if that's the case.
>
> Thanks so much!!
>
> --andy
> _______________________________________________
> 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
>
_______________________________________________
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