Added multiple list items, fixed bug that didn't deep-copy list items.

This commit is contained in:
Uli Kusterer 2003-08-07 21:42:25 +02:00
parent 1eb438215f
commit ee55720993
3 changed files with 15 additions and 2 deletions

View File

@ -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;
}

View File

@ -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];
}

2
TODO.txt Normal file
View File

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