Hi all,

I'm trying to encode a 'Class' type parameter in an class implementing the 
NSCoding interface, but I keep getting the error 'cannot encode (void *) value: 
<c0860200 01000000>'.

Here's an extract the class I'm encoding:

@interface IFNode : NSObject <NSCoding> {
        Class persistentObjectClass;
}
@property (nonatomic, retain) Class persistentObjectClass;
@end

@implementation IFNode
@synthesize persistentObjectClass;
- (void) encodeWithCoder: (NSCoder *) encoder {
        NSValue* value = [[NSValue valueWithPointer:persistentObjectClass] 
retain];
        [encoder encodeObject:value forKey:@"Class"];
}
- (id) initWithCoder: (NSCoder *) decoder {
        [((NSValue*)[decoder decodeObjectForKey:@"Class"]) 
getValue:persistentObjectClass];
        return self;
}
@end

Any help greatly appreciated.

Cheers,

Billy Flatman
b.flat...@googlemail.com


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to