diff --git a/GormClassManager.m b/GormClassManager.m index f33e89f8..4ee645e7 100644 --- a/GormClassManager.m +++ b/GormClassManager.m @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -1594,6 +1595,10 @@ NSMutableArray *actions = [NSMutableArray array]; NSMutableArray *outlets = [NSMutableArray array]; + // skip it, if it's category... for now. TODO: make categories work... + if([cls isCategory]) + continue; + while((method = (OCMethod *)[men nextObject]) != nil) { if([method isAction]) @@ -1610,10 +1615,20 @@ } } - [self addClassNamed: className - withSuperClassNamed: superClass - withActions: actions - withOutlets: outlets]; + if([self isKnownClass: superClass]) + { + [self addClassNamed: className + withSuperClassNamed: superClass + withActions: actions + withOutlets: outlets]; + } + else + { + result = NO; + [NSException raise: @"UnknownParentClass" + format: @"The superclass %@ of class %@ is not known, please parse it.", + superClass, className]; + } } } } diff --git a/GormDocument.m b/GormDocument.m index c2165771..4b924059 100644 --- a/GormDocument.m +++ b/GormDocument.m @@ -32,6 +32,7 @@ #include "GormFilePrefsManager.h" #include "GormViewWindow.h" #include +#include #include #include #include @@ -1259,18 +1260,30 @@ static NSImage *fileImage = nil; if (result == NSOKButton) { NSString *fileName = [oPanel filename]; - if(![classManager parseHeader: fileName]) + + NS_DURING { - NSString *message = [NSString stringWithFormat: - _(@"An error occurred while parsing %@"),fileName]; + if(![classManager parseHeader: fileName]) + { + NSString *message = [NSString stringWithFormat: + _(@"An error occurred while parsing %@"),fileName]; + NSRunAlertPanel(_(@"Problem parsing class"), + message, + nil, nil, nil); + } + else + { + return self; + } + } + NS_HANDLER + { + NSString *message = [localException reason]; NSRunAlertPanel(_(@"Problem parsing class"), message, nil, nil, nil); } - else - { - return self; - } + NS_ENDHANDLER } return nil; diff --git a/GormObjCHeaderParser/OCHeaderParser.m b/GormObjCHeaderParser/OCHeaderParser.m index 691d242f..22c63acc 100644 --- a/GormObjCHeaderParser/OCHeaderParser.m +++ b/GormObjCHeaderParser/OCHeaderParser.m @@ -68,16 +68,18 @@ NSString *finalString = [NSString stringWithString: @""]; // strip all of the one line comments out... + [scanner setCharactersToBeSkipped: nil]; while(![scanner isAtEnd]) { NSString *tempString = nil; [scanner scanUpToString: @"//" intoString: &tempString]; - [scanner scanUpToAndIncludingString: @"\n" intoString: NULL]; + [scanner scanUpToString: @"\n" intoString: NULL]; resultString = [resultString stringByAppendingString: tempString]; } // strip all of the multiline comments out... scanner = [NSScanner scannerWithString: resultString]; + [scanner setCharactersToBeSkipped: nil]; while(![scanner isAtEnd]) { NSString *tempString = nil; @@ -96,6 +98,7 @@ NSString *resultString = [NSString stringWithString: @""]; // strip all of the one line comments out... + [scanner setCharactersToBeSkipped: nil]; while(![scanner isAtEnd]) { NSString *tempString = nil;