diff --git a/ChangeLog b/ChangeLog index fa1b4a6b..53f6b9ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-09-28 22:27-EDT Gregory John Casamento + + * GormCore/GormClassManager.m: Allow addClassNamed:... to accept + arguments superClass, actions, and outlets as nil. + * GormObjCHeaderParser/OCClass.m: Correctly recognize a category + in [OCClass parse]; Corrects bug#17804. + 2006-09-28 20:38-EDT Gregory John Casamento * English.lproj/GormDocument.gorm: Added search field and drop down diff --git a/GormCore/GormClassManager.m b/GormCore/GormClassManager.m index 6d553b13..1c91e52d 100644 --- a/GormCore/GormClassManager.m +++ b/GormCore/GormClassManager.m @@ -269,9 +269,9 @@ { BOOL result = NO; NSString *classNameCopy = [NSString stringWithString: className]; - NSString *superClassNameCopy = [NSString stringWithString: superClassName]; - NSMutableArray *actionsCopy = [NSMutableArray arrayWithArray: actions]; - NSMutableArray *outletsCopy = [NSMutableArray arrayWithArray: outlets]; + NSString *superClassNameCopy = (superClassName != nil)?[NSString stringWithString: superClassName]:nil; + NSMutableArray *actionsCopy = (actions != nil)?[NSMutableArray arrayWithArray: actions]:[NSMutableArray array]; + NSMutableArray *outletsCopy = (outlets != nil)?[NSMutableArray arrayWithArray: outlets]:[NSMutableArray array]; // We make an autoreleased copy of all of the inputs. This prevents changes // to the original objects from reflecting here. GJC @@ -299,7 +299,10 @@ [classInfo setObject: outletsCopy forKey: @"Outlets"]; [classInfo setObject: actionsCopy forKey: @"Actions"]; - [classInfo setObject: superClassNameCopy forKey: @"Super"]; + if(superClassNameCopy != nil) + { + [classInfo setObject: superClassNameCopy forKey: @"Super"]; + } [classInformation setObject: classInfo forKey: classNameCopy]; // if it's a custom class add it to the list. @@ -1878,9 +1881,8 @@ } } - if([self isKnownClass: superClass] && - [cls isCategory] == NO && - superClass != nil) + if(([self isKnownClass: superClass] || superClass == nil) && + [cls isCategory] == NO) { if([self isKnownClass: className]) { @@ -1908,7 +1910,7 @@ { [self addActions: actions forClassNamed: className]; } - else if(superClass != nil) + else if(superClass != nil && [self isKnownClass: superClass] == NO) { result = NO; [NSException raise: NSGenericException diff --git a/GormObjCHeaderParser/OCClass.m b/GormObjCHeaderParser/OCClass.m index 397bd4e9..0f27e6e2 100644 --- a/GormObjCHeaderParser/OCClass.m +++ b/GormObjCHeaderParser/OCClass.m @@ -180,7 +180,12 @@ [iscan scanUpToCharactersFromSet: wsnl intoString: &cn]; className = [cn stringByTrimmingCharactersInSet: wsnl]; RETAIN(className); - isCategory = YES; + + // check to see if it's a category on an existing interface... + if(lookAhead(interfaceLine,@"(")) + { + isCategory = YES; + } } if(isCategory == NO)