i have a UISegmentControl which have 2 segment in my view,the problem is whatever segment i have choosed, it will return 1 in my selectedSegmentIndex property since i want it remain at the first view when select segment 0,the event i used in my segmentcontrol is valueChanged, and the function will be call as show below: -(void)segmentSelect:(id)sender{
NSInteger select=[sender selectedSegmentIndex];
if(select==0){
NSLog(@"this is 0");
}
else{
NSLog(@"this is 1");
infoViewController *viewController = [[infoViewController alloc]initWithNibName:@"infoView" bundle:[NSBundle mainBundle]];
[[self navigationController] pushViewController:viewController animated:YES];
[viewController release];
}
} can anybody tell what goes wrong?