Note that there are some explanatory texts on larger screens.

plurals
  1. POUISegmentedControl does not detect segment change in iOS5
    primarykey
    data
    text
    <p>I have a UISegmentedControl</p> <pre><code>UIBarButtonItem *flex = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]autorelease]; bottomSegmentedControl = [[UISegmentedControl alloc] initWithItems:nil]; [bottomSegmentedControl insertSegmentWithImage:[UIImage imageNamed:@"messages.png"] atIndex:0 animated:YES]; [bottomSegmentedControl insertSegmentWithImage:[UIImage imageNamed:@"news.png"] atIndex:1 animated:YES]; [bottomSegmentedControl insertSegmentWithImage:[UIImage imageNamed:@"chart.png"] atIndex:2 animated:YES]; //bottomSegmentedControl = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"Messages",@"News",@"Chart", nil]]; //bottomSegmentedControl.tintColor = [UIColor blackColor]; [bottomSegmentedControl addTarget:self action:@selector(segmentedControlChanged:)forControlEvents:UIControlEventValueChanged]; bottomSegmentedControl.segmentedControlStyle = UISegmentedControlStyleBar; bottomSegmentedControl.frame = CGRectMake(0,0,300,30); bottomSegmentedControl.momentary = NO; [bottomSegmentedControl setSelectedSegmentIndex:0]; UIBarButtonItem *segButton = [[UIBarButtonItem alloc] initWithCustomView:bottomSegmentedControl]; </code></pre> <p>When I step through the program <code>[bottomSegmentedControl setSelectedSegmentIndex:0];</code> does not trigger a UIControlEventValueChanged event which is where I do some stuff in <code>segmentedControlChanged:</code></p> <p>This used to work in iOS 4.3 but not in iOS5. How can I resolve this?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload