Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

i.yalovecky

macrumors member
Original poster
Feb 24, 2010
67
0
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.yalovecky

macrumors member
Original poster
Feb 24, 2010
67
0
I read about NSCoder compliant, i need to subclass NSTreeNode or better convert it to source string?
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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.
 

i.yalovecky

macrumors member
Original poster
Feb 24, 2010
67
0
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.

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.