aboutsummaryrefslogtreecommitdiffstats
path: root/Source/NSArray_DeepMutableCopy.m
diff options
context:
space:
mode:
authorbamse16 <marius@marius.me.uk>2009-04-11 09:14:42 +0000
committerbamse16 <marius@marius.me.uk>2009-04-11 09:14:42 +0000
commit1824ae6360c9ce1897e75404163d39df08ee5fbf (patch)
tree0eca1f6f4cb42e08f25e44a4683aecfb5881aac2 /Source/NSArray_DeepMutableCopy.m
parent41f8cde09ff77996339cabc71517496976beee2e (diff)
downloadsequelpro-1824ae6360c9ce1897e75404163d39df08ee5fbf.tar.gz
sequelpro-1824ae6360c9ce1897e75404163d39df08ee5fbf.tar.bz2
sequelpro-1824ae6360c9ce1897e75404163d39df08ee5fbf.zip
Added printing support via WebKit WebView
Diffstat (limited to 'Source/NSArray_DeepMutableCopy.m')
-rw-r--r--Source/NSArray_DeepMutableCopy.m42
1 files changed, 42 insertions, 0 deletions
diff --git a/Source/NSArray_DeepMutableCopy.m b/Source/NSArray_DeepMutableCopy.m
new file mode 100644
index 00000000..72f64c06
--- /dev/null
+++ b/Source/NSArray_DeepMutableCopy.m
@@ -0,0 +1,42 @@
+//
+// NSArray_DeepMutableCopy.m
+//
+// Created by Matt Gemmell on 02/05/2008.
+// Copyright 2008 Instinctive Code. All rights reserved.
+//
+
+#import "NSArray_DeepMutableCopy.h"
+
+
+@implementation NSArray (DeepMutableCopy)
+
+
+- (NSMutableArray *)deepMutableCopy;
+{
+ NSMutableArray *newArray;
+ unsigned int index, count;
+
+ count = [self count];
+ newArray = [[NSMutableArray allocWithZone:[self zone]] initWithCapacity:count];
+ for (index = 0; index < count; index++) {
+ id anObject;
+
+ anObject = [self objectAtIndex:index];
+ if ([anObject respondsToSelector:@selector(deepMutableCopy)]) {
+ anObject = [anObject deepMutableCopy];
+ [newArray addObject:anObject];
+ [anObject release];
+ } else if ([anObject respondsToSelector:@selector(mutableCopyWithZone:)]) {
+ anObject = [anObject mutableCopyWithZone:nil];
+ [newArray addObject:anObject];
+ [anObject release];
+ } else {
+ [newArray addObject:anObject];
+ }
+ }
+
+ return newArray;
+}
+
+
+@end