Size already determined

I've already fiddled with my Objective-C ++ namespace.

I found that Handle, Size and Duration are already defined in ObjC ++. How are they defined and where are they defined?

I only have #imported Foundation / Foundation.h

+2


a source to share


2 answers


MacTypes.h

typedef char *                          Ptr;
typedef Ptr *                           Handle;
typedef long                            Size;
typedef SInt32                          Duration;

      



All of this predated Carbon. They have nothing to do with Cocoa, although they fill the namespace.

+6


a source


You can Command-double-click a symbol in Xcode to see where it is defined, or use Open Quickly (Command-Shift-D) and enter the name of the symbol. Handle

, Size

and Duration

are in the CoreServices structure, for example.



To avoid conflicts, you should always use a unique, unique prefix (usually your initials or an abbreviated version of your project name) in your Objective-C globals. Take a look at this question which links to some Objective-C style guides.

+2


a source







All Articles