Reputation: 10011
I have a static method that should take two objects and a float as parameters. Everything is fine with the objects, but my float variable is lost. Here is a test case:
+ (void) someFunctionWithSomething: (xmlNodePtr *) node {
CGFloat fsize = 0;
if (fsize == 0) {
fsize = 15.0f;
}
NSLog (@"size1: %f", fsize); // output is 15.00000
[MyClass getFontWithSize: fsize];
}
+ (void) getFontWithSize: (CGFloat) fsize {
NSLog (@"size2: %f", fsize); // output is 0.00000
}
How come my variable becomes zero all of a sudden? Could this be related to the fact that I am calling a static method from within a static method? I have a feeling that this is something really simple that I am missing here. Ideas?
Upvotes: 3
Views: 2283
Reputation: 181290
Check that your header file has a prototype for getFontWithSize
that also matches your definition:
+(void) getFontWithSize: (CGFloat) fsize;
Maybe you have something different there.
Upvotes: 1