1

I'm the beginner on iOS development and iPad app programming. Now I'm working in an ipad splitview app in which I have multiple elements. In detail view of others view I added a UISegmentedControl and a UIView, what I want to do is when the Segmentedcontrol is switched the uiview should load and show another .nib file that i have in my project. My project is like this


Master --------------Detail


Picture ----> Picture View


Video ----> Video View.


Website ---> Website View.


Others-------> Others View ((UIsegmentedControl)) ---> another .nib file

So how can i do that? Thank u!!!

yugi_nhc
  • 11
  • 1

1 Answers1

0

To receive action of your UISegmentedControl being clicked you need to do

    [mySegmentedControl addTarget: self action: @selector(mySegControlClicked:) forControlEvents: UIControlEventValueChanged] ;

Then implement your mySegControlClicked function like

    -(void)mySegControlClicked: (UISegmentedControl*)sender 
    {
           switch([sender selectedSegmentIndex]) {
                   case 0: //nib loading code ; 
                       break ;
                   case 1: //nib loading code ; 
                       break ;
            } 
    }

For help with the Nib loading code see load view from a nib

Community
  • 1
  • 1
JordanC
  • 1,303
  • 12
  • 28