Beginner’s question: I dared to introduce constants into my little program. I first resisted, but then I thought I should give it a try… to see that it doesn’t work.
Okay, this is what I have put in the very first line of my .m file:
#define kPageCurlSpeed = 2.5;
And this is what I put in my method:
[UIView setAnimationDuration:kPageCurlSpeed];
And behold… it doesn’t work and I get the compiler message that “expected expression before “=” token”… I have no idea of how to translate that into English.
I thought the compiler simply replaces kPageCurlSpeed with 2.5 — so this shouldn’t cause any problems. But I guess that’s just theory.
Any help would be very much appreciated.
You don’t need
=in an#defineor the semicolon afterwards. Just useRead e.g. this wikipedia article on C preprocessor.