• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: saveDocument newbie question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Excluding native file type from saveDocumentTo: accessory view. (From: Joshua Scott Emmons <email@hidden>)
 >saveDocument newbie question (From: Neto <email@hidden>)
 >Re: saveDocument newbie question (From: Andrew Merenbach <email@hidden>)
 >Re: saveDocument newbie question (From: "Alan Smith" <email@hidden>)
 >Re: saveDocument newbie question (From: Neto <email@hidden>)

  • Prev by Date: Re: NSThread in Debug mode loading code issue
  • Next by Date: Re: NSDocument with fixed/auto-generated filename
  • Previous by thread: Re: saveDocument newbie question
  • Next by thread: Excluding native file type from export sheet.
  • Index(es):
    • Date
    • Thread