开发者

UISegmentedControl navigation problem in iPhone

I have made a segment control.

In that there is three segments..

Now I have used a single table in开发者_高级运维 which when I select different segments..different data appears accordingly in the rows of that table..

Now my problem ...

When I select segment 1...it should navigate to the FirstViewController...when I select row from appeared table

When I select segment 2...it should navigate to the SecondViewController...when I select row from appeared table

When I select segment 3...it should navigate to the ThirdViewController...when I select row from appeared table

where FirstViewController,SecondViewController,ThirdViewController are simple viewControllers with some Image

How to do this?


Done..

What I did..I did store the value of which segmented control is selected..

then according to the selected segment control ..I made the switch case in row did select..

rathodrc


In your tableview delegate method

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)newIndexPath

check the selected index of the segment control using segmentcontrol.selectedSegmentIndex. Depending upon this push whatever viewcontroller you require.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜