Search code examples
cocoainterface-builderpsmtabbarcontrol

Interface Builder error: IBXMLDecoder: The value for key is too large to fit into a 32 bit integer


I'm working with Robert Payne's fork of PSMTabBarControl that works with IB 3.2 (thanks BTW Robert!): http://codaset.com/robertjpayne/psmtabbarcontrol/. The demo application works fine on 64-bit systems, but when I try to open the XIB file in Interface Builder on a 32-bit system I get: IBXMLDecoder: The value (4654500848) for key (myTrackingRectTag) is too large to fit into a 32 bit integer

Building the app as 32 bit works, but then running it gives: PSMTabBarControlDemo[9073:80f] *** -[NSKeyedUnarchiver decodeInt32ForKey:]: value (4654500848) for key (myTrackingRectTag) too large to fit in 32-bit integer

Not sure if this is a generic IB issue that can occur when moving between 64 and 32 bit systems, or if this is a more specific issue with this code. Has anyone else run into this?


Solution

  • I got to the bottom of this and it has nothing to do with Interface Builder. The IB error was coming from the PSMTabBarControl IB plugin.

    For anyone else who runs into this, in PSMOverflowPopUpButton.m changing:

    [aCoder encodeInteger:_myTrackingRectTag forKey:@"myTrackingRectTag"];
    

    to

    [aCoder encodeInt64:_myTrackingRectTag forKey:@"myTrackingRectTag"];
    

    and

    _myTrackingRectTag = [aDecoder decodeIntegerForKey:@"myTrackingRectTag"];
    

    to

    _myTrackingRectTag = [aDecoder decodeInt64ForKey:@"myTrackingRectTag"];
    

    resolved the issue for me, and now it works for both the i386 and x86_64 architectures.