Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 25 lines (19 sloc) 0.504 kB
4f0c627 @allending First release.
authored
1 //
2 // Licensed under the terms in License.txt
3 //
4 // Copyright 2010 Allen Ding. All rights reserved.
5 //
6
7 #import "NSValue+KiwiAdditions.h"
8 #import "KWObjCUtilities.h"
9
10 @implementation NSValue(KiwiAdditions)
11
12 #pragma mark -
13 #pragma mark Accessing Data
14
15 - (NSData *)dataValue {
16 NSUInteger length = KWObjCTypeLength([self objCType]);
17 void *buffer = malloc(length);
18 [self getValue:buffer];
19 NSData *data = [NSData dataWithBytes:buffer length:length];
20 free(buffer);
21 return data;
22 }
23
24 @end
Something went wrong with that request. Please try again.