tags:

views:

59

answers:

1

I am a newbie on iPhone development.

I have declared a variable on my .m file like this

#define myFloat     60.0f

Now when I try to use this variable like

CGRect myFrame = CGRectMake(0.0f, 0.0f, myFloat, myFloat);

it says myFloat is undeclared!

How do I do that?

thanks.

A: 

Try putting the #define in the .h file.

Elijah W.
same problem!!!
Digital Robot
why do you need to use a #define?? Can't you just do: float myFloat 60.0;?
Elijah W.
it is a constant used on several methods.
Digital Robot
Like Horace Ho said, the code looks fine...somethings happening in some other part of your code. Can you isolate your problem?? For example, keep commenting lines out until you don't get an error. This is good for small codes, but obviously not for large codes.
Elijah W.
thanks guys! it was a typo, but not on the code, but in one of the file names being included!!!!!
Digital Robot
no problem! :D .
Elijah W.