Tableview leads to a new view with page control?

Discussion in 'iOS Programming' started by Zolta, Dec 8, 2011.

  1. Zolta macrumors newbie

    Joined:
    Nov 21, 2011
    #1
    Hi!
    I'm trying to build an application where you can pick something from a tableview that leads to another view where you can switch between texts with PageControl.
    I have no problem with these 2 things separately. So, I can make a TableView lead to an other view, and I also can build an app with PageControl.
    But I've just couldn't make them together yet.

    Do you have any idea how to do that?
    The TableView pushes to a UIViewControllerSubclass, while the PageControl should be an Object class, and I think these two just don't pass together.
    What should I change?
    So basically, the new view is a UIViewControllerSubClass, while the page controller looks something like this...

    Code:
    @interface PageControlExampleAppDelegate : [B]NSObject[/B] <UIApplicationDelegate , UIScrollViewDelegate> {
        UIWindow *window;
    	IBOutlet UIScrollView *scrollView;
        IBOutlet UIPageControl *pageControl;
        NSMutableArray *viewControllers;
        BOOL pageControlUsed;
    }
    
    @property (nonatomic, retain) IBOutlet UIWindow *window;
    @property (nonatomic, retain) UIScrollView *scrollView;
    @property (nonatomic, retain) UIPageControl *pageControl;
    @property (nonatomic, retain) NSMutableArray *viewControllers;
    
    - (IBAction)changePage:(id)sender;
    
    @end
    Anything could help. Thank you.
    (Sorry if it's a lame question, I'm quite new to this)
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    You should move the scrollView and pageControl out of the appDelegate, which isn't meant for this purpose, and into their own viewController. Then it will be rather trivial to transition to it.
     

Share This Page