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;
}
}
Replace everywhere you use the instance variable with property and access it though it and you will not have any problems with the memory management.