Re: Making my own constants for Cocoa structs
Re: Making my own constants for Cocoa structs
- Subject: Re: Making my own constants for Cocoa structs
- From: Scott Ribe <email@hidden>
- Date: Fri, 03 Aug 2007 12:11:10 -0400
- Thread-topic: Making my own constants for Cocoa structs
> I didn't realize that these structures could be
> treated the same as a C array (?).
They're simply C structs, and follow the standard C syntax for
initialization.
Note that in some versions of C, const NSRect myConstRect={1,2,3,4}; will
give a warning, because actually using the layout of the structure is
preferred, as in const NSRect myConstRect={{1,2},{3,4}}; since an NSRect is
an NSPoint and NSSize.
Also note that there are macros defined: NSMakeRect, NSMakePoint, and
NSMakeSize. These are documented in a place you probably haven't yet found,
because they're lumped together with a lot of simple functions that don't
belong to any class, while most of the Coco docs are arranged around
classes. Just search on any of those macros...
--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden