mirror of
https://github.com/nickshanks/ResKnife.git
synced 2024-06-06 20:29:29 +00:00
Added multiple list items, fixed bug that didn't deep-copy list items.
This commit is contained in:
parent
1eb438215f
commit
ee55720993
|
@ -38,6 +38,7 @@
|
||||||
-(id) copyWithZone: (NSZone*)zone
|
-(id) copyWithZone: (NSZone*)zone
|
||||||
{
|
{
|
||||||
NuTemplateElement* el = [[[self class] allocWithZone: zone] initForType: type withLabel: label];
|
NuTemplateElement* el = [[[self class] allocWithZone: zone] initForType: type withLabel: label];
|
||||||
|
//NuTemplateElement* el = [[[self class] alloc] initForType:type withLabel:label];
|
||||||
|
|
||||||
return el;
|
return el;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,10 +29,20 @@
|
||||||
-(id) copyWithZone: (NSZone*)zone
|
-(id) copyWithZone: (NSZone*)zone
|
||||||
{
|
{
|
||||||
NuTemplateGroupElement* el = [super copyWithZone: zone];
|
NuTemplateGroupElement* el = [super copyWithZone: zone];
|
||||||
|
|
||||||
if( el )
|
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];
|
[el setSubElements: arr];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user