0

i have a master detail application where in the detail view there is a text field with some information taken from a plist file store in bundle in viewdidload i define

self.description.text=[self.myobject objectForKey:@"description"];

now i would like to put a segmented control so as when user clicks first the "description" will be shown taken from plist as for second segmented i also have a key in plist file called "medical" with the help of if statement i have made an IBAction for the segmented control

- (IBAction)changeText:(id)sender {

if (segmentedControls.selectedSegmentIndex == 0) {
    description.text=[self.botan objectForKey:@"description"];
}
else if(segmentedControls.selectedSegmentIndex == 1){
    meddescription.text =[self.botan objectForKey:@"medical"];
    }

}

have also added the outlet to the.h file

IBOutlet UISegmentedControl *segmentedControls;

but when i run the app the segmented control change to the second segment but without changing the text from the plist the key medical that i mentioned earlier any ideas?

Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
  • I've read this question a couple times and I still don't understand what the problem is, Ioannis. – Michael Dautermann Jan 25 '14 at 21:16
  • Could it because of typo "meddescription.text"? – ldindu Jan 25 '14 at 22:03
  • Michael I have in my detail view a text field that uses data taken from the plist to display it. Now I would like to add to that view a segmented control so as when u ores second segment to have new data again from plist shown.hope I cleared things out a bit;;; – Ioannis Gman Jan 25 '14 at 23:52

0 Answers0