-
My .h, DepartText is the Dubai textfield,Picker is pickerview,and Segment Control is segment control,SegmentText is price textfield, and Depart1 is again the Dubai textfield.
-
So here I have the picker view row showing in the textfield.
-
The DepartText gives an error, this is where I am confused. What should I do to make this the 1st textfield display the price in the next textfield. With the segment controller.
.h file-
@interface ViewController5 : UIViewController{
IBOutlet UITextField *DepartText;
IBOutlet UIPickerView *Picker;
NSArray *PickerData;
}
@property (retain, nonatomic) IBOutlet UIPickerView *Picker;
@property (retain, nonatomic) IBOutlet NSArray *PickerData;
@property (weak, nonatomic) IBOutlet UISegmentedControl *SegmentControl;
- (IBAction)SegmentButton:(id)sender;
@property (weak, nonatomic) IBOutlet UITextField *SegmentText;
@property (weak, nonatomic) IBOutlet UITextField *Depart1Text;
@end
.m file-
if (select == 0) {
DepartText.text = @"Abidjan,Côte d’Ivoire";
} else
if (select == 1) {
DepartText.text = @"Abu Dhabi,UAE";
- (IBAction)SegmentButton:(id)sender {
}
- (IBAction)Depart:(id)sender {
if ([self.Depart1Text.text isEqual: @"Zürich,Switzerland"]) {
self.SegmentText.text = @"$1731";
}
}
@end
Aucun commentaire:
Enregistrer un commentaire