Problem implementing keyPathsForvaluesAffecting<Key>
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