Bug in Code

閲覧: 0 回
最初の未読メッセージにスキップ

williamc

未読、
2009/02/09 23:17:362009/02/09
To: ObjectiveResource
There's a bug in the code that results in certain class names not
being serialized properly when doing a findRemote call on the object
ID. This bug existed iin the object_resource zip file that I
downloaded:


FromXMLElementDelegate.m (Around line 52)
//Start of the root object
else if (parsedObject == nil && [elementName isEqualToString:
[self.targetClass xmlElementName]]) {
NSLog(@"starting on the root object");
self.parsedObject = [[[self.targetClass alloc] init] autorelease];
[self.unclosedProperties addObject:[NSArray arrayWithObjects:
[elementName camelize], self.parsedObject, nil]];
self.currentPropertyName = [elementName camelize];
}

elementName is not being camelized before being compared to
xmlElementName. To fix this elementname needs to be camelized:
else if (parsedObject == nil && [[elementName camelize]
isEqualToString:[self.targetClass xmlElementName]]) {


This is a pretty significant bug that prevents XML from serializing
properly.


Josh Vickery

未読、
2009/02/10 8:36:572009/02/10
To: objectiv...@googlegroups.com
This does look like a bug. I created a ticket to track this on
lighthouse: http://yfactorial.lighthouseapp.com/projects/18393/tickets/40-bug-in-deserializing-camelcase-in-fromxmldelegate

Thanks for the finding this williamc!

Josh
全員に返信
投稿者に返信
転送
新着メール 0 件