Open GoogleCodeExporter opened 9 years ago
This example did not include Elements as the class I used didn't require it. It
needs a little bit of work to add element objects to the resulting dictionary.
- (NSDictionary*) serializeElementsDictionary {
NSMutableDictionary* d = [[[NSMutableDictionary alloc] init] autorelease];
if (self.ElementId != nil)
[d setObject:self.ElementId forKey:@"ElementId"];
return [NSDictionary dictionaryWithDictionary:d];
}
- (NSDictionary*) serializeDictionary: (NSString*) nodeName {
NSDictionary* v = [self serializeAttributesDictionary];
NSMutableDictionary* d = [[NSMutableDictionary dictionaryWithObject:v forKey:nodeName] autorelease];
NSDictionary* e = [self serializeElementsDictionary];
for (id key in [e allKeys])
[d setObject:[e objectForKey:key] forKey:key];
return [NSDictionary dictionaryWithDictionary:d];
}
Original comment by lumin...@gmail.com
on 20 Apr 2011 at 4:09
Original issue reported on code.google.com by
lumin...@gmail.com
on 20 Apr 2011 at 3:55