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.
Some common synonyms of problem are enigma, mystery, puzzle, and riddle. While all these words mean "something which baffles or perplexes," problem applies to a question or difficulty calling for a solution or causing concern.
Problem-solving skills are the ability to identify problems, brainstorm and analyze answers, and implement the best solutions.
You don't need =
in an #define
or the semicolon afterwards. Just use
#define kPageCurlSpeed 2.5
Read e.g. this wikipedia article on C preprocessor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With