diff --git a/ChangeLog b/ChangeLog index b3badb491..e0891e7d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-11-30 Matt Rice + + * Source/NSBundle.m (-principalClass): If the class specified in + NSPrincipalClass key is not found return the first class found. + * Headers/Foundation/NSBundle.h (-principalClass): Document the above. + 2004-11-29 Adam Fedor * configure.ac: Check for libffi or callback/avcall libs diff --git a/Headers/Foundation/NSBundle.h b/Headers/Foundation/NSBundle.h index e3580c356..7b55ea677 100644 --- a/Headers/Foundation/NSBundle.h +++ b/Headers/Foundation/NSBundle.h @@ -189,9 +189,9 @@ GS_EXPORT NSString* const NSLoadedClasses; /** Returns the principal class of the bundle. This is the class specified by the NSPrincipalClass key in the Info-gnustep property - list contained in the bundle. If this key is not found, the - class returned is arbitrary, although it is typically the first - class compiled into the archive. + list contained in the bundle. If this key or the specified class + is not found, the class returned is arbitrary, although it is + typically the first class compiled into the archive. */ - (Class) principalClass; diff --git a/Source/NSBundle.m b/Source/NSBundle.m index 3faa694df..29abf5472 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -1077,7 +1077,8 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory) { _principalClass = NSClassFromString(class_name); } - else if ([_bundleClasses count]) + + if (!_principalClass && [_bundleClasses count]) { _principalClass = [[_bundleClasses objectAtIndex: 0] nonretainedObjectValue];