-
Feature Request
-
Resolution: Done
-
Major
-
1.0.0.M6
-
None
The iOS library assumes that a key is only present inside of the "object representation map", when the value is NOT nil:
if ([object objectForKey:_recordId]) {
//TODO: NSLog(@"HTTP PUT to update the given object");
id key = [object objectForKey:_recordId];
NSString* updateId;
if ([key isKindOfClass:[NSString class]]) {
updateId = key;
} else {
updateId = [key stringValue];
}
[_restClient putPath:[self appendObjectPath:updateId] parameters:object success:successCallback failure:failureCallback];
return;
}
This is wrong - but our demo model was coded that way, that the key is only present when not nil, so we never saw the issue:
-(NSDictionary *)dictionary {
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
if (self.recId != nil)
[dict setObject:[self.recId stringValue] forKey:@"id"];
[dict setObject:self.title forKey:@"title"];
[dict setObject:self.style forKey:@"style"];
return dict;
}