First off, just wanted to thank those who helped me in my earlier thread. I got a Cocoa app up and running in pretty short time.
I'm working on a few more bits to the app and I have a question. Is there a way to access the value that gets returned from a method (hopefully I got my terms straight)?
Here's the code I'm working on:
What I want to do is use the value that gets returned for calcPerformance in one more calculation and then display that value again. I think I could work it out by adding another variable and instead of returning the value, just put the value equal to a variable and make it a void method. But it seems like it would be simpler if I could access that value another way.
Also, quick question. I can't find much on tutorials or help on adding a TabView to my interface. I'd like to be able to switch between 3 different interfaces if possible..
I'm working on a few more bits to the app and I have a question. Is there a way to access the value that gets returned from a method (hopefully I got my terms straight)?
Here's the code I'm working on:
Code:
-(float) calcPerformance
{
if((int)currentTemp % 10 == 0)
{
return lowAltLowTemp + self.pressureFactor * (highAltLowTemp - lowAltLowTemp);
}
else if((int)pressureAltitude % 1000 == 0)
{
return lowAltLowTemp + self.tempFactor * (lowAltHighTemp - lowAltLowTemp);
}
else
{
return (valueTop + self.pressureFactor * (valueBottom - valueTop));
}
}
What I want to do is use the value that gets returned for calcPerformance in one more calculation and then display that value again. I think I could work it out by adding another variable and instead of returning the value, just put the value equal to a variable and make it a void method. But it seems like it would be simpler if I could access that value another way.
Also, quick question. I can't find much on tutorials or help on adding a TabView to my interface. I'd like to be able to switch between 3 different interfaces if possible..