I have defined a constant in my some file and added in file where i wanna use it as shown below.
#define myMapID 1
But the problem is when i passed开发者_如何学Python the value to a method as a parameter, the compiler gives warning, and yes it must do but how can i avoid warnings ?
-(void) methodName :(int) mapId
{
//printID
}
[self methodName :myMapID];
Just use a (global) static/constant int, much clearer than #define and won't give a warning.
Odd that it would give you a warning on that. try:
#define myMapID (int) 1
maybe?
精彩评论