Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the standard for sharing constant defined variables

As the title says - in Java I would just make a class define the constants then import them into the classes that will be using them. Is it done the same way in Objective-C?

To make it clear, I want to

#define variable 1
#define variable 2.0

And use the same constants in different classes.

like image 292
Tom Lilletveit Avatar asked Jan 21 '26 20:01

Tom Lilletveit


1 Answers

Put the macros in a header file, and #include or #import that header file whenever you need to access them.