Skip to content

Commit

Permalink
Invalid properties on objects does not crash the binding now, so we c…
Browse files Browse the repository at this point in the history
…an have read-only properties on domain objects.
  • Loading branch information
escoz committed Jul 22, 2013
1 parent d386d2f commit 73be21d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions quickdialog/QBindingEvaluator.m
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,14 @@ - (void)fetchValueFromObject:(QElement *)element toData:(id)data {
NSString *valueName = [((NSString *) [bindingParams objectAtIndex:1]) stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];

if (![propName isEqualToString:@"iterate"] && ![valueName isEqualToString:@"self"]) {
id value = [element valueForKeyPath:propName];
if (propName!= nil && value!=nil)
[data setValue:value forKeyPath:valueName];
@try {
id value = [element valueForKeyPath:propName];
if (propName!= nil && value!=nil)
[data setValue:value forKeyPath:valueName];
}
@catch (NSException *exception) {
NSLog(@"Couldn't set property %@ on object %@", valueName, data);
}
}
}

Expand Down

0 comments on commit 73be21d

Please sign in to comment.