UISegmentedControl and Touch events
does anyone know how you get touch events from a UISegmentedControl?
I have done this.
UISegmentedControl * mySegmentedControl = [[UISegmentedControl alloc] initWithFrame:ButtonsRect];
mySegmentedControl.momentary = YES;
mySegmentedControl.segmentedControlStyle = UISegmentedControlStyleBordered;
[mySegmentedControl insertSegmentWithTitle:@"some text" atIndex:0 animated:NO];
[mySegmentedControl addTarget:self action:(SEL)@selector(buttonPressed:) forControlEvents:UIControlEventTouchDown];
I have implemented a method called buttonPressed, but it never gets called.
What am I missing?
Thanks
Adrian
MacBook, Mac OS X (10.5.2), 2Gb Ram