diff --git a/AppKit/CPKeyValueBinding.j b/AppKit/CPKeyValueBinding.j index 3e0989998..263fc3435 100644 --- a/AppKit/CPKeyValueBinding.j +++ b/AppKit/CPKeyValueBinding.j @@ -454,8 +454,7 @@ var CPBindingOperationAnd = 0, if (![CPBinder isBindingAllowed:aBinding forObject:self]) { - [CPException raise:CPGenericException - reason:@"Cannot bind " + aBinding + " because a binding with the same functionality is already in use."]; + CPLog.warn([self description] + " : cannot bind " + aBinding + " because another binding with the same functionality is already in use."); return; } //if (![[self exposedBindings] containsObject:aBinding]) diff --git a/Tests/AppKit/CPKeyValueBindingTest.j b/Tests/AppKit/CPKeyValueBindingTest.j index 701e1d858..8412e18a9 100644 --- a/Tests/AppKit/CPKeyValueBindingTest.j +++ b/Tests/AppKit/CPKeyValueBindingTest.j @@ -342,7 +342,7 @@ [self assert:@"brie" equals:[control2 objectValue] message:@"control2 objectValue is wrong"]; } -- (void)testExclusiveBindingsThrowsException +- (void)testExclusiveBindings { var segmented = [[CPSegmentedControl alloc] initWithFrame:CGRectMakeZero()]; [segmented setSegmentCount:3]; @@ -351,10 +351,13 @@ [segmented bind:CPSelectedIndexBinding toObject:model withKeyPath:@"cheese" options:nil]; - [self assertThrows:function() - { - [segmented bind:CPSelectedTagBinding toObject:model withKeyPath:@"cheese" options:nil]; - }]; + // Try to bind another binding (mutually exclusive) to the same value. + [segmented bind:CPSelectedTagBinding toObject:model withKeyPath:@"cheese" options:nil]; + + [self assertNotNull:[segmented infoForBinding:CPSelectedIndexBinding]]; + + // Check that the source is not binded with the CPSelectedTagBinding + [self assertNull:[segmented infoForBinding:CPSelectedTagBinding]]; } @end