diff --git a/NuTemplateEditor/NuTemplateElement.m b/NuTemplateEditor/NuTemplateElement.m index 724b404..ddaa099 100644 --- a/NuTemplateEditor/NuTemplateElement.m +++ b/NuTemplateEditor/NuTemplateElement.m @@ -38,6 +38,7 @@ -(id) copyWithZone: (NSZone*)zone { NuTemplateElement* el = [[[self class] allocWithZone: zone] initForType: type withLabel: label]; + //NuTemplateElement* el = [[[self class] alloc] initForType:type withLabel:label]; return el; } diff --git a/NuTemplateEditor/NuTemplateGroupElement.m b/NuTemplateEditor/NuTemplateGroupElement.m index eedd4e5..c886f9d 100644 --- a/NuTemplateEditor/NuTemplateGroupElement.m +++ b/NuTemplateEditor/NuTemplateGroupElement.m @@ -29,10 +29,20 @@ -(id) copyWithZone: (NSZone*)zone { NuTemplateGroupElement* el = [super copyWithZone: zone]; - + if( el ) { - NSMutableArray* arr = [[[NSMutableArray allocWithZone:zone] autorelease] initWithArray:subElements copyItems:YES]; + NSMutableArray* arr = [[subElements mutableCopy] autorelease]; + NSEnumerator* enny = [arr objectEnumerator]; + NSObject* obj; + unsigned x = 0; + + while( obj = [enny nextObject] ) + { + [arr replaceObjectAtIndex:x withObject: [[obj copy] autorelease]]; + x++; + } + [el setSubElements: arr]; } diff --git a/TODO.txt b/TODO.txt new file mode 100644 index 0000000..e9be76c --- /dev/null +++ b/TODO.txt @@ -0,0 +1,2 @@ +-> "Open as Hex" displays "(null)" as the document name. Why? +-> Template editor always forces at least one item in a list. Make it support empty lists. \ No newline at end of file