• 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
Problem implementing keyPathsForvaluesAffecting<Key>
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem implementing keyPathsForvaluesAffecting<Key>


  • Subject: Problem implementing keyPathsForvaluesAffecting<Key>
  • From: "email@hidden" <email@hidden>
  • Date: Wed, 22 Apr 2009 15:45:49 +0100

The property canDelete is dependent on three other properties as shown below.

Is there a problem with my implementation of + keyPathsForValuesAffectingCanDelete with regard to the key path @"arrayController.canRemove"?

Modifying property1 and property2 results in the re-evaluation of - canDelete.
Removing all items in the array bound to arrayController does not cause -canDelete to be evaluated, even though [arrayController canRemove] becomes NO.


- (BOOL)canDelete
{
	BOOL canRemove = [arrayController canRemove];
	if (self.property1 && self.property2) {
		canRemove = NO;
	}

	return canRemove;
}


+ (NSSet *)keyPathsForValuesAffectingCanDelete
{
return [NSSet setWithObjects:@"property1", @"property2", @"arrayController.canRemove", nil];
}


Jonathan Mitchell

Central Conscious Unit
http://www.mugginsoft.com




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Problem implementing keyPathsForvaluesAffecting<Key>
      • From: Jim Correia <email@hidden>
    • Re: Problem implementing keyPathsForvaluesAffecting<Key>
      • From: "Sean McBride" <email@hidden>
    • Re: Problem implementing keyPathsForvaluesAffecting<Key>
      • From: Keith Duncan <email@hidden>
    • Re: Problem implementing keyPathsForvaluesAffecting<Key>
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Time since Login?
  • Next by Date: Re: Really big files and encodings
  • Previous by thread: Re: How to make app login window to look like OS X user login window ?
  • Next by thread: Re: Problem implementing keyPathsForvaluesAffecting<Key>
  • Index(es):
    • Date
    • Thread