individualPercUpdated
is called on UIControlEventEditingDidEnd
and checkInitialValue
is callled on UIControlEventEditingDidBegin
. My prog crash on line if(!([initialValue isEqualToString:textField.text]))
by giving warning Exec Bad Access
- (void)viewDidLoad
{
[super viewDidLoad];
initialValue=[[NSString alloc] init];
}
-(void) individualPercUpdated:(UITextField *)textField{
if(initialValue!=nil){
if(!([initialValue isEqualToString:textField.text])){
initialValue=textField.text;
NSLog(@"%@",textField.text);
}
}
else{
NSLog(@"%@",textField.text);
}
}
-(void) checkInitialValue:(UITextField *)textField{
initialValue=textField.text;
}
}