+ Reply
Results 1 to 3 of 3

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: Switch Views in Tab Bar Applications XCODE

is a discussion within the

OS Apps and Development

forums, a part of the

Computer Modding Software

section;
I would like to Switch Views in a Tab Bar app, not by klicking on the tab bar, but with a regular button like in the screenshot: Ive tried it
...
  1. #1
    Green Apple Maxner's Avatar
    Join Date
    Mar 2011
    Posts
    99
    Thanks
    3
    Thanked 10 Times in 7 Posts

    Default Switch Views in Tab Bar Applications XCODE
    I would like to Switch Views in a Tab Bar app, not by klicking on the tab bar, but with a regular button like in the screenshot:


    Ive tried it with several methods and it didnt work, please help!

  2. #2
    Green Apple Maxner's Avatar
    Join Date
    Mar 2011
    Posts
    99
    Thanks
    3
    Thanked 10 Times in 7 Posts

    nobody? please, i really need help!

  3. #3
    What's Jailbreak? masbog's Avatar
    Join Date
    Dec 2011
    Location
    INDONESIA
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    define view controller one by one, and then save all into NSArray, like this...

    feedViewController *feed = [[feedViewController alloc] initWithNibName:@"feedViewController" bundle:nil];
    instagramViewController *insta = [[instagramViewController alloc] initWithNibName:@"instagramViewController" bundle:nil];
    twitViewController *twit = [[twitViewController alloc] initWithNibName:@"twitViewController" bundle:nil];
    pimpViewController *pimp = [[pimpViewController alloc] initWithNibName:@"pimpViewController" bundle:nil];

    viewControllers = [[NSArray alloc] initWithObjects:feed, insta, twit, pimp,nil]; //define NSArray in header
    and then on button click set self.viewController = [viewController objectAtIndex]; //where viewcontroller you want to use
    so [self.view addSubview:[[viewController objectAtIndex] view]];

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts