Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 54 lines (44 sloc) 2.098 kb
24dca8d Uli Kusterer Deep copy categories for NSArray, NSSet, and NSDictionary.
authored
1 //
2 // NSDictionary+DeepCopy.h
3 // UKSyntaxColoredDocument
4 //
5 // Created by Uli Kusterer on Tue May 18 2004.
720b0e7 Uli Kusterer Added licensing information to the source files.
authored
6 // Copyright (c) 2004 M. Uli Kusterer.
7 //
8 // This software is provided 'as-is', without any express or implied
9 // warranty. In no event will the authors be held liable for any damages
10 // arising from the use of this software.
11 //
12 // Permission is granted to anyone to use this software for any purpose,
13 // including commercial applications, and to alter it and redistribute it
14 // freely, subject to the following restrictions:
15 //
16 // 1. The origin of this software must not be misrepresented; you must not
17 // claim that you wrote the original software. If you use this software
18 // in a product, an acknowledgment in the product documentation would be
19 // appreciated but is not required.
20 //
21 // 2. Altered source versions must be plainly marked as such, and must not be
22 // misrepresented as being the original software.
23 //
24 // 3. This notice may not be removed or altered from any source
25 // distribution.
24dca8d Uli Kusterer Deep copy categories for NSArray, NSSet, and NSDictionary.
authored
26 //
27
28 /*
29 This category adds a method to NSDictionary that performs a deep copy of all
30 instead of the usual shallow copy. For any objects inside it, it calls deepCopy
31 again, unless they don't implement that selector, then a regular copy will
32 be done.
33 */
34
35 // -----------------------------------------------------------------------------
36 // Headers:
37 // -----------------------------------------------------------------------------
38
39 #import <Foundation/Foundation.h>
40
41
42 // -----------------------------------------------------------------------------
43 // Interface:
44 // -----------------------------------------------------------------------------
45
46 @interface NSDictionary (UKDeepCopy)
47
48 -(NSDictionary*) deepCopy; // Call deepCopy on anything that understands it, copy on anything else.
49
50 -(NSMutableDictionary*) deepMutableContainerCopy; // Call deepMutableContainerCopy on anyone that understands it, copy on anything else.
51 -(NSMutableDictionary*) deepMutableCopy; // Call deepMutableCopy on anyone that understands it, mutableCopy on anything else.
52
53 @end
Something went wrong with that request. Please try again.