Re: n00b question about includes
Re: n00b question about includes
- Subject: Re: n00b question about includes
- From: "Juan Nunez-Iglesias" <email@hidden>
- Date: Sat, 11 Aug 2007 10:55:54 +0200
Unless I'm misreading the question, just create a file, e.g.
constants.h, that has all your constants, and write
#import "constants.h"
near the start of all your files that need this.
Incidentally, I've always been taught to use global const variables
rather than #defines. e.g. instead of
#define FOO 5
write
const double FOO = 5;
Notice how in this case you clear up an ambiguity about the type of FOO.
Juan.
On 8/11/07, d2kagw <email@hidden> wrote:
> hey there,
>
> If I have tonnes of #defines declaring constants for my application
> (things like user preference keys, and model names etc) which I want
> to be made available to all the classes i'm writing (so I don't have
> to update all my classes every time I change/add a key)
> Is there a way I can include some file that contains these defines?
> that get included at build time?
>
> sorry for the uber n00b question.
>
> thanks for your help.
>
> _______________________________________________
>
> 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
>
_______________________________________________
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