I'm trying to use methods to pass values from text fields in one view to corresponding text fields in another view. The action valuesChanged is wired to the event "Editing Did End" on the text fields. I tried using "Value Changed" with similar results (it doesn't work.). The only warning I receive is in a method call.
Here's the code for the VolumeViewController:
@implementation VolumeViewController
@synthesize boxWidth;
@synthesize boxHeight;
@synthesize boxLength;
@synthesize sphereRadius;
@synthesize boxResult;
@synthesize sphereResult;
@synthesize areaViewController;
-(IBAction)valuesChanged:(id)sender
{
NSString *length = boxLength.text;
NSString *width = boxWidth.text;
NSString *radius = sphereRadius.text;
NSLog(@"length: %@", length);
NSLog(@"width: %@", width);
NSLog(@"radius: %@", radius);
[areaViewController changeValues:width :length :radius];
}
-(void)changeValues:(NSString*)widthString :(NSString*)lengthString :(NSString*)radiusString
{
boxWidth.text = widthString;
boxLength.text = lengthString;
sphereRadius.text = radiusString;
}
As you can see, the valuesChanged action instantiates three NSString objects, each corresponding to the text properties of a text field. These strings are then passed to the changeValues method of the areaViewController. The areaViewController's changeValues method is identical to the volumeViewController's method, other than the text field names being different. However, the NSLog commands that I have never show anything in the console, so it's obvious that despite my text fields being connected to the action, it is not being called. What do I need to fix?
The warning is given after the method call "[areaViewController changeValues:width :length :radius], and it reads 'UIViewController' may not respond to '-changeValues:::'