Model initiated change in bindings
Model initiated change in bindings
- Subject: Model initiated change in bindings
- From: Jules Bonin-Ducharme <email@hidden>
- Date: Sat, 10 Jul 2004 08:59:38 -0700
Hi List!
Ok, I'm a little confused. Here is the situation. I have a Cardon Dynamic
Library that holds all the data. My Cocoa app can access that data with
accessor functions. At frame rate, the library makes a callback to indicate
which values changed.
I have designed my Cocoa app with MVC. My model classes are basically
wrappers to the dynamic library's data. Instead of having instance
variables, I only have accessor methods. For example:
- (int)level
{
return inputLevel(channelNumber);
}
- (void)setLevel:(int)lvl
{
setInputLevel(channelNumber, lvl);
}
InputLevel is a function in the library
channelNumber is an instance variable of the class
I have an AppController that holds an instance of my model and an outlet of
an NSArrayController. I have an NSTableView displaying the values.
All the bindings work great. I can edit values and they display themselves.
Finally here is my question. How do I communicate that the model has
changed some of its values? What should I do inside the callback function
from the library? Just doing [table setNeedsDisplay:YES] seems un-efficient
since this is happening at frame rate. I'd love to only refresh the values
that changed.
I hope I'm making sense here. Can anyone give me a hint?
Jules Bonin-Ducharme
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.