Tab Bar app - Desperate for help. :(

Discussion in 'iOS Programming' started by missyeve, Dec 31, 2010.

  1. missyeve, Dec 31, 2010
    Last edited by a moderator: Dec 31, 2010

    missyeve macrumors newbie

    Joined:
    Dec 31, 2010
    #1
    Hello there!

    I am a university student and Im creating an application for my uni project. My deadline is mid January and Im really struggling. I have been browsing all forums and you tube for some help but no luck. So this forum is my last and final help and I really pray to God that someone can help me with this app.

    Basically I am completely knew to Xcode and I dont know what I need to use in order to have a tab bar application where in one of the tabs I will have the screen divided into 4 cells and each will behave separately and display different images from the iphone library. That way a user can scroll images and mix and match tops with bottoms and accessories and create an outfit which later can be saved and stored in a separate tab bar called "favourites" .

    something like this:

    ex2.jpg



    Something like this:

    [​IMG]


    This is my blog which explains what i want to create (virtual wardrobe where you can create outfits on the iphone)

    I would be so so grateful if you could help me. Please!

    this is my link: http://k0833787.tumblr.com/

    Thank you in advance and in return I am willing to pay for some help or a video tutorial. Mod note: not allowed, see forum rules - kainjow

    Guys please help me out!!!! :(
     

    Attached Files:

  2. zachsilvey macrumors 6502

    Joined:
    Feb 5, 2008
    Location:
    Battle Ground
    #2
    If you are new to Xcode then that means you are likely to be new to Objective-C and the whole iOS SDK.

    Do you have any programming experience?

    If not then there is absolutely no hope to get this done by mid-january.

    I have been working with the iOS SDK for about a year and that would be a big project for me.

    I say this because I think you should probably pick a different project.
     
  3. cnstoll, Jan 2, 2011
    Last edited: Jan 2, 2011

    cnstoll macrumors 6502

    Joined:
    Aug 29, 2010
    #3
    Here' goes...

    The easy part of your project is making a window with a tab bar at the bottom. The hard part is what each page is going to do.

    Here's a link to the View Controller Programming Guide section on Tab Bar Controllers. link

    From what I've seen it's also easier to just create the Tab Bar Controller from code, rather than using Interface Builder. I think Apple even recommends just doing it from code. I noticed on your blog that you've already started working on it there...but I would suggest scrapping that and trying to do it in code. It's actually easier than you might think, and it's a good exercise for you to get your feet wet. The steps are basically this:

    1) In your Application Delegate, create an instance of a UITabBarController.
    2) Create some UINavigationController objects and initialize them with each of your various View Controllers which will become the pages for the individual tabs.
    3) Assign a UIImage to the "tabBarItem" property of each UINavigationController which is the image the bar will display.
    4) Create an array with these Navigation Controllers and give it to the Tab Bar Controller.
    5) call [window addSubview:yourTabBarViewController.view];

    Here's some code to illustrate:

    Code:
    // Create Tab Bar Controller
    UITabBarController *tabBarController = [[UITabBarController alloc] init];
    
    // Create an instance of one of your View Controllers
    SomeViewController *viewController = [[SomeViewController alloc] initWithStyle:UITableViewStylePlain]; // Subclass of UITableViewController
    
    // Define Navigation Controller
    UINavigationController navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
    navigationController.tabBarItem.image = [UIImage imageNamed:@"tab1.png"];
    
    // Add View Controllers to Tab Bar Controller
    tabBarController.viewControllers = [NSArray arrayWithObjects:navigationController, navigationController2, navigationController3, nil];
    
    You're going to have three "layer's" of View Controllers. The top one is the UITabBarController, then the UINavigationControllers, and finally your own ViewControllers. The standard way of doing paging like you've described, with cells or buttons that link to different pages, is a UITableViewController within the UINavigationController.

    I hope that helps. Do yourself a favor and read Apple's View Controller Programming guide cover to cover. It really does explain most everything you need to know about making this work. Good luck.
     

Share This Page