discuss-gnustep
[
Top
][
All Lists
]
Advanced
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
]
Determining the length of an objCType
From
:
Andreas Hoeschler
Subject
:
Determining the length of an objCType
Date
:
Mon, 9 Dec 2002 20:00:38 +0100
Hi all,
I need to encode NSValue on my own (in a category of NSValue). The primitives of NSValue are:
- (const char *)
objCType
- (void)
getValue:
(void *)
buffer
I would like to do something like
const char *objCType = [self objCType];
int length = sizeof(objCType); // <-----------
void *buffer = malloc(length);
[self getValue:buffer];
[archiver encodeString:[NSString stringWithCString:objCType] withName:@"type"];
[archiver encodeData:[NSData dataWithBytes:buffer length:length] withName:@"value"];
free(buffer);
The marked line of course is incorrect. But how can I get the necessary buffer size from an objC type?
Thanks a lot,
Andreas
reply via email to
[Prev in Thread]
Current Thread
[
Next in Thread
]
Determining the length of an objCType
,
Andreas Hoeschler
<=
Re: Determining the length of an objCType
,
Marcus Müller
,
2002/12/09
Re: Determining the length of an objCType
,
Richard Frith-Macdonald
,
2002/12/10
Prev by Date:
NSHost & DHCP
Next by Date:
Making GNUstep base (gsdoc) on Solaris fails
Previous by thread:
NSHost & DHCP
Next by thread:
Re: Determining the length of an objCType
Index(es):
Date
Thread