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: Paul Bruneau <email@hidden>
- Date: Fri, 3 Aug 2007 12:00:41 -0400
On Aug 3, 2007, at 11:49 AM, Stephane Sudre wrote:
On 3 août 07, at 17:15, Paul Bruneau wrote:
Please forgive if this is too simple for this list, but I have
been googling this for an hour with no success.
How best do I make a constant that is one of the Cocoa structure
types such as NSSize or NSRect?
I have a default size I want to have available throughout a class.
A perfect example of an existing one is NSZeroSize. How do I make
my own constant size (or rect) like that?
Thank you!
#import <Foundation/Foundation.h>
extern const NSRect myConstRect;
--------8<-----------8<----------8<----------
#import "MtConstantPrototypeHeader.h"
const NSRect myConstRect={1,2,3,4};
thank you, that worked great. It was the {1,2...} notation that I was
clueless about. I didn't realize that these structures could be
treated the same as a C array (?). I guess the C array just puts
those values one after the other in memory, which matches the way the
NS structures are?
Thanks again_______________________________________________
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