discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Encode and Decode an NSMapTableKeyCallBacks: expected struct and got uns


From: Philip Mötteli
Subject: Encode and Decode an NSMapTableKeyCallBacks: expected struct and got unsigned int
Date: Tue, 13 Apr 2004 11:12:41 +0200

Hi


I encode some information about a MapTable:

        - (void)ecnodeWithCoder:(NSCoder *)aCoder
        {
                …
[aCoder encodeValueOfObjCType:@encode(NSMapTableKeyCallBacks) at:&keyCallBack];
                …
        }


I decode it like this:

        - initWithCoder:(NSCoder *)aCoder
        {
                …
[aCoder decodeValueOfObjCType:@encode(NSMapTableKeyCallBacks) at:&keyCallBack];
                …
        }


This decoding translates into the following call of the unarchiver's decodeValueOfObjCType:

- (void)decodeValueOfObjCType:"{_NSMapTableKeyCallBacks=^?^?^?^?^?^v}" at:0x…


During decoding, the typeCheck function is called:

        typeCheck(t1='{', t2=6 '\006')


Which in turn looks up its parameters in the type map:

        type_map[('\006' & _GSC_MASK)] != '{'


Unfortunately this map doesn't give a satisfying value back:

        Exception: NSInternalInconsistencyException
        REASON: expected struct and got unsigned int


Is this a bug? I mean, I can't change a lot here. Everything is handled by the system.


Thanks!
Phil





reply via email to

[Prev in Thread] Current Thread [Next in Thread]