Interact with app while it's running
I am trying to do things like calculate answers after taking user input. Lets say I have two empty textfields, you enter a number in each and it gives you your answer. I have the code that I want to run but this code runs right when the View loads and not again so all my numbers stay 0. If someone could tell me where to run code while my application is running or even give me a keyword so that I can search the topic. I've tried my e-books but none of them seem to have anything on it that I can find through a search. I tried a main method but that just created so many more problems. Thanks in advance.
This is the method I want to get to and use again and again
- (BOOL)textField:(UITextField *)TextFieldChecker shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
NSString *comparison = [formulas objectForKey:NAME_KEY];
//read your text field value
double layFlatValue = [layFlat.text doubleValue];
//do whatever math you need to do, update your total label
if ([comparison isEqualToString:(@"Blow-Up Ratio (BUR)")]) {
blowUpRatio.text = [NSString stringWithFormat: @"%.4f", layFlatValue*0.637];
}
return YES;
}
Last edited by Moe2392; 08-27-2011 at 03:07 PM.
Reason: Code
|