2004-11-30 Matt Rice <ratmice@yahoo.com>

* 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.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20401 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
ratmice 2004-11-30 22:16:32 +00:00
parent 753df57a03
commit 652609e55d
3 changed files with 11 additions and 4 deletions

View file

@ -1,3 +1,9 @@
2004-11-30 Matt Rice <ratmice@yahoo.com>
* 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 <fedor@gnu.org> 2004-11-29 Adam Fedor <fedor@gnu.org>
* configure.ac: Check for libffi or callback/avcall libs * configure.ac: Check for libffi or callback/avcall libs

View file

@ -189,9 +189,9 @@ GS_EXPORT NSString* const NSLoadedClasses;
/** Returns the principal class of the bundle. This is the class /** Returns the principal class of the bundle. This is the class
specified by the NSPrincipalClass key in the Info-gnustep property specified by the NSPrincipalClass key in the Info-gnustep property
list contained in the bundle. If this key is not found, the list contained in the bundle. If this key or the specified class
class returned is arbitrary, although it is typically the first is not found, the class returned is arbitrary, although it is
class compiled into the archive. typically the first class compiled into the archive.
*/ */
- (Class) principalClass; - (Class) principalClass;

View file

@ -1077,7 +1077,8 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
{ {
_principalClass = NSClassFromString(class_name); _principalClass = NSClassFromString(class_name);
} }
else if ([_bundleClasses count])
if (!_principalClass && [_bundleClasses count])
{ {
_principalClass = [[_bundleClasses objectAtIndex: 0] _principalClass = [[_bundleClasses objectAtIndex: 0]
nonretainedObjectValue]; nonretainedObjectValue];