On Dec 15, 2009, at 6:36 PM, Jerry Krinock wrote:

Concentrate on this one:

http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Archiving/Tasks/codingctypes.html

Ok. I changed -transformedValue: of the custom value transformer to look like this.

     - (id)transformedValue:(id)value
     {
         Foo foo;
         [value getValue:&foo];
         NSMutableData *data = [NSMutableData dataWithCapacity:64];
         NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc]
              initForWritingWithMutableData:data];
         [archiver encodeDouble:foo.e.a forKey:@"e.a"];
         [archiver encodeDouble:foo.e.b forKey:@"e.b"];
         [archiver encodeDouble:foo.e.c forKey:@"e.c"];
         [archiver encodeDouble:foo.e.d forKey:@"e.d"];
         [archiver encodeDouble:foo.f.a forKey:@"f.a"];
         [archiver encodeDouble:foo.f.b forKey:@"f.b"];
         [archiver encodeDouble:foo.f.c forKey:@"f.c"];
         [archiver encodeDouble:foo.f.d forKey:@"f.d"];
         [archiver finishEncoding];
         return [NSKeyedArchiver archivedDataWithRootObject:value];
     }

When I save the document I get an error: *** -[NSKeyedArchiver encodeValueOfObjCType:at:]: this archiver cannot encode structs.

Any ideas what's wrong?

--Richard

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to