FROM : Christiaan Hofman
DATE : Tue May 20 01:16:16 2008
On 19 May 2008, at 6:01 PM, David Dunham wrote:
>
> On 18 May 2008, at 23:42, Scott Stevenson wrote:
>
>>> I've got a key which is calculated (it's the number of topics
>>> which are filtered by a search string). As the user types into a
>>> search field, I need to update this derived value. How else can I
>>> let KVO know the calculated value has changed, so it can be
>>> displayed in the UI?
>>
>> In general, you can just set derived keys to be dependent on the
>> "real" key, and the change notifications happen automatically. On
>> Tiger, you use +setKeys:triggerChangeNotificationsForDependentKey:
>> in +initialize.
>>
>> Are you able to use this?
>
>
> There is no other key -- it's a value calculated by applying a test
> to all topics and counting the number of YESes.
>
> David Dunham A Sharp, LLC
> Voice/Fax: 206 783 7404 http://a-sharp.com
> Efficiency is intelligent laziness.
Basically what mmalc is saying (as I understand it) is to /add/ a
property for this derived key, and when the "real" keys update (i.e.
from observeValue:...) you set the derived property using KVC
compliant methods, so the change is noted. It's rather a hassle and
needs extra ivars.
Christiaan
DATE : Tue May 20 01:16:16 2008
On 19 May 2008, at 6:01 PM, David Dunham wrote:
>
> On 18 May 2008, at 23:42, Scott Stevenson wrote:
>
>>> I've got a key which is calculated (it's the number of topics
>>> which are filtered by a search string). As the user types into a
>>> search field, I need to update this derived value. How else can I
>>> let KVO know the calculated value has changed, so it can be
>>> displayed in the UI?
>>
>> In general, you can just set derived keys to be dependent on the
>> "real" key, and the change notifications happen automatically. On
>> Tiger, you use +setKeys:triggerChangeNotificationsForDependentKey:
>> in +initialize.
>>
>> Are you able to use this?
>
>
> There is no other key -- it's a value calculated by applying a test
> to all topics and counting the number of YESes.
>
> David Dunham A Sharp, LLC
> Voice/Fax: 206 783 7404 http://a-sharp.com
> Efficiency is intelligent laziness.
Basically what mmalc is saying (as I understand it) is to /add/ a
property for this derived key, and when the "real" keys update (i.e.
from observeValue:...) you set the derived property using KVC
compliant methods, so the change is noted. It's rather a hassle and
needs extra ivars.
Christiaan






Cocoa mail archive

