I am trying to set up a two-component collector and getting some errors that I commented on:
Implementation File:
#import "BIDDoubleComponentPickerViewController.h" @implementation BIDDoubleComponentPickerViewController @synthesize doublePicker; @synthesize fillingTypes; @synthesize breadTypes; - (IBAction)buttonPressed:(id)sender { NSInteger fillingRow = [doublePicker selectedRowInComponent:kFillingComponent]; // Use of undeclared identifier 'kFillingComponent' NSInteger breadRow = [doublePicker selectedRowInComponent:kBreadComponent]; // Use of undeclared identifier 'kBreadComponent' NSString *bread = [breadTypes objectAtIndex:breadRow]; NSString *filling = [fillingTypes objectAtIndex:fillingRow]; NSString *message = [[NSString alloc]initWithFormat:@"Your %@ on %@ bread will be right up", filling, bread]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Thank you for your order" message:message delegate:nil cancelButtonTitle:@"Great!" otherButtonTitles:nil]; [alert show]; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. NSArray *fillingArray = [[NSArray alloc] initWithObjects:@"Ham", @"Turkey", @"Peanut Butter", @"Tuna Salad", @"Chicken Salad", @"Roast Beef", @"Vegemite", nil]; self.fillingTypes = fillingArray; NSArray *breadArray = [[NSArray alloc] initWithObjects:@"White", @"Whole Wheat", @"Rye", @"Sourdough Bread", @"Seven Grain", nil]; self.breadTypes = breadArray; } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // eg self.myOutlet = nil; self.doublePicker = nil; self.breadTypes = nil; self.fillingTypes = nil; }
Interface File:
source share