Merge branch 'master' of git://github.com/280north/cappuccino

This commit is contained in:
Randall Luecke committed 2010-12-19 20:19:02 -05:00
commit 14226ef69c
3 files changed
+26 -14

No files matched your search

+2 -1
View File
@@ -1152,7 +1152,8 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
_numberOfRows = [_dataSource numberOfRowsInTableView:self];
else
{
CPLog(@"no content binding established and data source " + [_dataSource description] + " does not implement numberOfRowsInTableView:");
if (_dataSource)
CPLog(@"no content binding established and data source " + [_dataSource description] + " does not implement numberOfRowsInTableView:");
_numberOfRows = 0;
}
+1
View File
@@ -27,6 +27,7 @@
@import "CPButton.j"
@import "CPScrollView.j"
@import "CPTextField.j"
@import "CPTableView.j"
@import "CPWindow.j"
@import "_CPMenuWindow.j"
+23 -13
View File
@@ -109,29 +109,39 @@ NIB_CONNECTION_EQUIVALENCY_TABLE = {};
@end
var NSTramsformers = [CPSet setWithObjects:
@"NSNegateBoolean",
@"NSIsNil",
@"NSIsNotNil",
@"NSUnarchiveFromData",
@"NSKeyedUnarchiveFromData"];
@implementation CPCibBindingConnector (NSCoding)
- (id)NS_initWithCoder:(CPCoder)aCoder
{
if (self = [super NS_initWithCoder:aCoder])
self = [super NS_initWithCoder:aCoder];
if (self)
{
_binding = [aCoder decodeObjectForKey:@"NSBinding"];
_keyPath = [aCoder decodeObjectForKey:@"NSKeyPath"];
_options = [CPDictionary dictionary];
var nsoptions = [aCoder decodeObjectForKey:@"NSOptions"],
keyEnum = [nsoptions keyEnumerator],
aKey;
while (aKey = [keyEnum nextObject])
var NSOptions = [aCoder decodeObjectForKey:@"NSOptions"],
keyEnumerator = [NSOptions keyEnumerator],
key;
while (key = [keyEnumerator nextObject])
{
var CPKey = [CPString stringWithFormat:@"CP%@", aKey.substring(2)],
nsvalue = [nsoptions objectForKey:aKey],
nstramsformers = [CPArray arrayWithObjects:@"NSNegateBoolean", @"NSIsNil", @"NSIsNotNil", @"NSUnarchiveFromData", @"NSKeyedUnarchiveFromData"];
if (CPKey == CPValueTransformerNameBindingOption && [nstramsformers containsObject:nsvalue])
nsvalue = [CPString stringWithFormat:@"CP%@", nsvalue.substring(2)];
[_options setObject:nsvalue forKey:CPKey];
var CPKey = @"CP" + key.substring(2),
NSValue = [NSOptions objectForKey:key];
if (CPKey === CPValueTransformerNameBindingOption && [NSTramsformers containsObject:NSValue])
NSValue = @"CP" + NSValue.substring(2);
[_options setObject:NSValue forKey:CPKey];
}
CPLog.debug(@"Binding Connector: " + [_binding description] + " to: " + _destination + " " + [_keyPath description] + " " + [_options description]);