Encodings of structures in ivars include the encoding of the field names (this is actually really nice: we could - in theory - expose structure field members via KVC, as an extension). This case was not correctly handled by libobjc2.

main
theraven 15 years ago
parent 63c2c0ce73
commit 61a9379c9c

@ -95,6 +95,22 @@ static void parse_struct_or_union(const char **type, type_parser callback, void
while (**type != endchar) while (**type != endchar)
{ {
// Structure elements sometimes have their names in front of each
// element, as in {NSPoint="x"f"y"f} - We need to skip the type name
// here.
//
// TODO: In a future version we should provide a callback that lets
// users of this code get the field name
if ('"'== **type)
{
do
{
(*type)++;
} while ('"' != **type);
// Skip the closing "
(*type)++;
}
*type = callback(*type, context); *type = callback(*type, context);
} }
// skip } // skip }

Loading…
Cancel
Save