Skip navigation.
 
mlRe: Forcing a refresh on a bound control
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

Related mailsAuthorDate
mlForcing a refresh on a bound control Trent Jacobs May 15, 23:10
mlRe: Forcing a refresh on a bound control Christiaan Hofman May 15, 23:35
mlRe: Forcing a refresh on a bound control mmalc Crawford May 18, 08:18
mlRe: Forcing a refresh on a bound control Christiaan Hofman May 18, 12:20
mlRe: Forcing a refresh on a bound control Clark Cox May 18, 12:34
mlRe: Forcing a refresh on a bound control Christiaan Hofman May 18, 13:53
mlRe: Forcing a refresh on a bound control mmalc Crawford May 18, 16:25
mlRe: Forcing a refresh on a bound control Christiaan Hofman May 18, 16:44
mlRe: Forcing a refresh on a bound control mmalc Crawford May 18, 16:52
mlRe: Forcing a refresh on a bound control Scott Stevenson May 19, 00:57
mlRe: Forcing a refresh on a bound control David Dunham May 19, 05:04
mlRe: Forcing a refresh on a bound control Scott Stevenson May 19, 08:42
mlRe: Forcing a refresh on a bound control Trent Jacobs May 19, 09:40
mlRe: Forcing a refresh on a bound control David Dunham May 19, 18:01
mlRe: Forcing a refresh on a bound control Hamish Allan May 20, 01:14
mlRe: Forcing a refresh on a bound control Christiaan Hofman May 20, 01:16
mlRe: Forcing a refresh on a bound control Hamish Allan May 20, 01:30
mlRe: Forcing a refresh on a bound control David Dunham May 20, 18:21
mlRe: Forcing a refresh on a bound control Hamish Allan May 20, 21:14