[PATCH] Working NSSearchFieldCell archiving support
From:
Quentin Mathé
Subject:
[PATCH] Working NSSearchFieldCell archiving support
Date:
Mon, 7 Sep 2009 13:44:21 +0200
Hi,
Here is a patch to fix NSSearchFieldCell archiving and keyed archiving. Non-keyed archiving was crashing because _max_recents ivar was declared as an unsigned char and encoded/decoded as an unsigned int. Keyed archiving was not crashing because keyed decoding was not implemented. The patch adds keyed encoding to -encodeWithCoder:.
In a nib (a xib precisely), NSMaximumRecents is encoded as an int, so I switched to int as the encoded type (rather than unsigned int). I also changed the ivar from unsigned char to int to keep the encoding/decoding as simple as possible. I doubt any application has more than 4 or 5 search fields in use at the same time so it doesn't seem worth to save some memory.