Re: saveDocument newbie question
Re: saveDocument newbie question
- Subject: Re: saveDocument newbie question
- From: Kevin Hoctor <email@hidden>
- Date: Mon, 19 Jun 2006 21:15:02 -0500
On Jun 19, 2006, at 10:10 AM, Neto wrote:
I have an array->arraycontroller->tableView.
I need to trigger an updateChangeCount when the array is edited.
Neto,
I use a technique for watching when data changes (found in the Aaron
Hillegass book) to track undo/redo operations. It states you could
also use this for updating the change count as well:
// set a watch for each object in the array
e = [objectArray objectEnumerator];
while (object = [e nextObject]) {
[self startObservingObject:object];
}
- (void)startObservingObject:(Object *)object
{
// do this for each value you want to observe
[account addObserver:self
forKeyPath:@"memberOfObject"
options:NSKeyValueObservingOptionOld
context:NULL];
}
- (void)observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
change:(NSDictionary *)change
context:(void *)context
{
// react to the value change by incrementing or decrementing the
change count
}
I'm very new at this stuff, so I'm sure others can chime in with a
better explanation. There are bookend routines also for stopping the
observations as well.
Peace,
Kevin
http:kevinhoctor.blogspot.com
_______________________________________________
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