Hi i have a function on a class which is like this :
- (Float32)averagePower {
if (![self isListening])
return 0.0;
float tmp = [self levels][0].mAveragePower;
tmp = tmp * 100;
NSLog(@"%f", tmp);
return tmp;
}
i am calling it from viewdidload of another class like this:
SoundSensor *theInstance = [[SoundSensor alloc] init];
[theInstance listen];
Float32 tmp;
[theInstance averagePower:tmp];
now i can call to listen but when calling to averagepower i got warning that it may not respond and the function is crashing in simulation.
what i do wrong ?
thanks a lot.
You are trying to pass a variable to a function that accepts no parameters.
What I expect you meant to do is this: