I've restored implementation of that class (GradientColor). Actually, it stores a really small amount of data:
@interface GradientColor : NSView <NSCoding> {
float location;
NSColor *color;
}
@end
@implementation GradientColor
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeFloat:location forKey:@"location"];
[aCoder encodeObject:color forKey:@"color"];
}
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
if (self) {
location = [aDecoder decodeFloatForKey:@"location"];
color = [aDecoder decodeObjectForKey:@"color"];
}
return self;
}
@end
My version does nothing, but serializes and deserializes correctly as original implementation. I've looked needed keys and their types in plist itself. Now my CLI utility generates valid project files.
Here I found a good post on internal structure of NSKeyedArchive, it helped me a lot: http://digitalinvestigation.wordpress.com/2012/04/04/geek-post-nskeyedarchiver-files-what-are-they-and-how-can-i-use-them/