0

The issue is like this: Constants in Objective-C

So we declare the constant once in .h files and set it's value in .m

Is there a way to declare constant and define it at the same time?

I mean real constant, not macro (though macro is fine too, and it's faster anyway, and has no disadvantage anyway)

Community
  • 1
  • 1
user4951
  • 32,206
  • 53
  • 172
  • 282

2 Answers2

2

What about

#define MY_CONSTANT 9
Antonio MG
  • 20,382
  • 3
  • 43
  • 62
2

hope this will work

  #define MY_VALUE 165.0
Vinay
  • 171
  • 1
  • 7
  • Dude your answer is exactly the same with the other guy and it really should be #. Very well, I am point source. Cool. +1 – user4951 Apr 19 '12 at 08:26