• 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
change notification for dependent key between classes?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

change notification for dependent key between classes?


  • Subject: change notification for dependent key between classes?
  • From: Alexander Lamb <email@hidden>
  • Date: Mon, 12 Jun 2006 15:42:54 +0200

Hello list,

I have a very simple model:

projects have many tasks
each task has one person (the owner of the task).

So in reverse, people have many tasks.

Basically, it is a many to many between projects and people with tasks in the middle.

Now, the problem:

I want to have the list of people on a project. To do so, I implemented in my project class:

- (NSSet *)peopleOnProject
	{
	return [self valueForKeyPath:@"email@hidden"];
	}

This works fine.

In order to have peopleOnProject change notify my bindings, I added in my project class:

+ (void)initialize
{
[self setKeys:[NSArray arrayWithObjects:@"tasks",nil] triggerChangeNotificationsForDependentKey:@"peopleOnProject"];
}


So this works fine when I add or remove tasks to a project, the "peopleOnProject" will be recalculated (and displayed).

Now, what if for a given task I change the owner. The "tasks" attribute has not been changed to peopleOnProject will not trigger a change.


Is there a simple way for doing a triggerChangeNotificationForDependentKey on an attribute of a second class?


Thanks,

Alex
--
Alexander Lamb
email@hidden



_______________________________________________
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


  • Follow-Ups:
    • Re: change notification for dependent key between classes?
      • From: Alexander Lamb <email@hidden>
  • Prev by Date: Re: Apple Data Plotting Framework
  • Next by Date: Re: Apple Data Plotting Framework
  • Previous by thread: [solved] Re: NSTreeController woes... NSZombie at doc closed
  • Next by thread: Re: change notification for dependent key between classes?
  • Index(es):
    • Date
    • Thread