diff --git a/ChangeLog b/ChangeLog index 40b505225..9b62258ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-10-26 Richard Frith-Macdonald + + * Source/NSData.m: When deserialising selectors, register new + selectors if they don't already exist - so we can unarchive a + selector into a program where no objects implements it (we might + still want to use it over DO or to store in another archive). + Change suggested by N.Pero. + 2000-10-24 Adam Fedor * Source/NSCalendarDate.m (-initWithString:calendarFormat:locale:): diff --git a/Source/NSData.m b/Source/NSData.m index 3a92265a2..454510fa0 100644 --- a/Source/NSData.m +++ b/Source/NSData.m @@ -1121,9 +1121,20 @@ failure: } if (sel == 0) { - [NSException raise: NSInternalInconsistencyException - format: @"can't find sel with name '%s' " - @"and types '%s'", name, types]; + if (lt) + { + sel = sel_register_typed_name(name, types); + } + else + { + sel = sel_register_name(name); + } + if (sel == 0) + { + [NSException raise: NSInternalInconsistencyException + format: @"can't make sel with name '%s' " + @"and types '%s'", name, types]; + } } *(SEL*)data = sel; } @@ -2187,9 +2198,20 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos) } if (sel == 0) { - [NSException raise: NSInternalInconsistencyException - format: @"can't find sel with name '%s' " - @"and types '%s'", name, types]; + if (lt) + { + sel = sel_register_typed_name(name, types); + } + else + { + sel = sel_register_name(name); + } + if (sel == 0) + { + [NSException raise: NSInternalInconsistencyException + format: @"can't make sel with name '%s' " + @"and types '%s'", name, types]; + } } *(SEL*)data = sel; }