iphone - UISegmentControl problem -


I have a UISegmentControl, which has 2 segments in my view, the problem is that whatever area I have selected When I want to be in the first view, when Segment 0 is selected, I have changed the event value used in my Segment, and the function will show the call below: Since my selected Segment index property in 1 remains. (Zero) Segment: Select: ID Sender {

NSInteger select = [from selected SEgeIndex]; If (choose == 0) {NSLog (@ "this is 0"); } Other {nslog (@ "this is 1"); InfoViewController * viewController = [[infoViewController alloc] initWithNibName: @ "info view" bundle: [NSBundle main bundle]]; [[Self-Navigation Controller] Push ViewController: Animated Visual Controller: Yes]; [See Controller Release]; }

} Can anyone be wrong?

Try something like this:

  - (zero) Select Segment: (ID) Sender {UISegmentedControl * segmentedControl = sender; Switch ([Segment control selected Segment index]) {Case: NSLog (@ "This is 0"); break; Case 1: NSLog (@ "This is 1"); // push the controller brake; Default: NSLog (@ "This is unpredictable"); }}  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -