Separate names with a comma.
Discussion in 'Mac Programming' started by i.yalovecky, Sep 2, 2010.
Can i encode and decode my NSTreeNode tree with NSCoder?
Have you tried?
I don't know how.
The best way for me:
[self.constantsView.rootTreeNode setObjectValue:[aDecoder decodeObject]];
[aCoder encodeObject:[self.constantsView.rootTreeNode objectValue]];
But nothing like objectValue there. I construct tree from plist, i can do reverse and after decoder and encode strings, but still hope for something easier way.
I read about NSCoder compliant, i need to subclass NSTreeNode or better convert it to source string?
The simple answer is that NSTreeNode does not confirm to NSCoding (as you could easily have seen by looking at the documentation). As such it cannot be encoded using a NSCoder.
Ok, i convert my tree into plist NSString and encode it and decode it, but how now i can initialize NSDictionary with string? Because initially my tree initialized from plist through dictionary.
i decide to convert my Tree into Dictionary firstly. So i dont need convertation from string to dictionary.