Move createCustomClassRecordForId:... to parent class

This commit is contained in:
Gregory John Casamento 2022-03-28 18:47:41 -04:00
parent 33fea1762d
commit 39bd359505
3 changed files with 29 additions and 18 deletions

View file

@ -45,16 +45,27 @@
}
+ (BOOL) checkXib5: (NSData *)data;
+ (NSKeyedUnarchiver *) unarchiverForReadingWithData: (NSData *)data;
- (void) _initCommon;
- (id) decodeObjectForXib: (GSXibElement*)element
forClassName: (NSString*)classname
withID: (NSString*)objID;
- (id) _decodeArrayOfObjectsForElement: (GSXibElement*)element;
- (id) _decodeDictionaryOfObjectsForElement: (GSXibElement*)element;
- (id) objectForXib: (GSXibElement*)element;
- (void) createCustomClassRecordForId: (NSString *)theId
withParentClass: (NSString *)parentClassName
forCustomClass: (NSString *)customClassName;
- (NSArray *) customClasses;
- (NSDictionary *) decoded;
@end

View file

@ -765,21 +765,6 @@ static NSArray *XmlBoolDefaultYes = nil;
[super dealloc];
}
- (void) createCustomClassRecordForId: (NSString *)theId
withParentClass: (NSString *)parentClassName
forCustomClass: (NSString *)customClassName
{
if (theId == nil || customClassName == nil)
return;
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
theId, @"id",
parentClassName, @"parentClassName",
customClassName, @"customClassName",nil];
[_customClasses addObject: dict];
// NSLog(@"theId = %@, parentClassName = %@, customClassName = %@", theId, parentClassName, customClassName);
}
- (void) parser: (NSXMLParser*)parser
didStartElement: (NSString*)elementName
namespaceURI: (NSString*)namespaceURI

View file

@ -198,9 +198,10 @@
{
NSXMLElement *refNode = [refNodes objectAtIndex: 0];
NSString *refId = [refNode stringValue];
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
refId, @"id", sc, @"parentClassName", cn, @"customClassName", nil];
[_customClasses addObject: dict];
[self createCustomClassRecordForId: refId
withParentClass: sc
forCustomClass: cn];
}
}
}
@ -1111,4 +1112,18 @@ didStartElement: (NSString*)elementName
return _customClasses;
}
- (void) createCustomClassRecordForId: (NSString *)theId
withParentClass: (NSString *)parentClassName
forCustomClass: (NSString *)customClassName
{
if (theId == nil || customClassName == nil)
return;
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
theId, @"id",
parentClassName, @"parentClassName",
customClassName, @"customClassName",nil];
[_customClasses addObject: dict];
}
@end