Re: static typing (Learning Cocoa Chapter 13)
Re: static typing (Learning Cocoa Chapter 13)
- Subject: Re: static typing (Learning Cocoa Chapter 13)
- From: Ondra Cada <email@hidden>
- Date: Sun, 23 Sep 2001 12:51:40 +0200
Jeff,
>
>>>>> Jeff Binder (JB) wrote at Sat, 22 Sep 2001 17:48:28 -0400:
JB> Actually, I use handles in my Cocoa program as a resizable,
JB> multidimentional array for storing vertices. It's more convenient than
JB> using pointer arithmetic. And don't tell me to use NSArrays, it would be
JB> far too slow (I'm storing vertices and normals to send to OpenGL).
...
>
>>>>> Brendan Younger (BY) wrote at Sat, 22 Sep 2001 18:19:50 -0400:
BY> Not quite, Ondra. Check out NSFormatter
BY> -getObjectValue:forString:errorDescription:. There are others too, I
BY> just haven't bothered to find them.
I would beg to differ in opinion of calling those things "handles". So far
as I remember the Mac OS API I've used till I went NeXTStep, "handle" was not
a generic synonyme for any pointer to a pointer, but a very special name of
a very special OS-controlled pointer to a pointer, whose contents was in some
situations changed by OS (to limit fragmentation). That brought some quite
special programming considerations, which do not apply to normal C pointers
to pointers (and which I _personally_ regarded as a uniquely bad design, but
that's irrelevant here).
_These_ things don't exist in Cocoa anymore. Of course you can -- and
_sometimes_ even should -- use pointers to pointers, and even pointers to
pointers to pointers to pointers or so -- in any API. That does not make them
"handles" though.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc