mirror of
https://github.com/nickshanks/ResKnife.git
synced 2024-06-14 09:29:28 +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
|
||||
{
|
||||
NuTemplateElement* el = [[[self class] allocWithZone: zone] initForType: type withLabel: label];
|
||||
//NuTemplateElement* el = [[[self class] alloc] initForType:type withLabel:label];
|
||||
|
||||
return el;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,17 @@
|
|||
|
||||
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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user