Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4258696
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:41:02+00:00 2026-05-21T05:41:02+00:00

I’ve just begun Objective-C and am looking to find a way to create an

  • 0

I’ve just begun Objective-C and am looking to find a way to create an iPhone app that will launch with a Main Menu consisting of maybe around 8 or 9 buttons.

When the buttons are pressed it will link to a Scrolling Text view (containing a good few paragraphs of text) with an accompanying image at the top of the screen, which will act as a “Back” button to return to the Main Menu. I was also looking it to animate/behave as a modalview (where the new view scrolls up from the bottom of the screen, and scrolls back down when dismissed/Back-button pressed).

I have got the Tab Views working within a modal view (which is brought up from pressing a button in the Main Menu) and have worked out how to assign a custom icon to each tab. I’ve also added a custom background for each Tab. Though I’m still having trouble adding scrolling views to each Tab, where I can insert pictures and text programmatically. I would really appreciate any help you could give me with this..

Thanks very much!!

.h

    #import <UIKit/UIKit.h>

@interface MasseurViewController : UIViewController {
    UITabBarController *tbc;
}

-(IBAction)showHeadTabBar;
-(void)dismissTabBar;

@property (nonatomic, retain) UITabBarController *tbc;

@end

.m

#import "MasseurViewController.h"

@implementation MasseurViewController

@synthesize tbc;

//---Implement all the possible Tab Bar views


-(IBAction)showHeadTabBar{

    //---Define Back button

    UIImage *backImage = [UIImage imageNamed:@"headBackButton.png"];

    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(0.0f, 0.0f, backImage.size.width, backImage.size.height);
    [button setImage:backImage forState:UIControlStateNormal];
    [button addTarget:self action:@selector(dismissTabBar) forControlEvents:UIControlEventTouchUpInside];

    UIButton *button2 = [UIButton buttonWithType:UIButtonTypeCustom];
    button2.frame = CGRectMake(0.0f, 0.0f, backImage.size.width, backImage.size.height);
    [button2 setImage:backImage forState:UIControlStateNormal];
    [button2 addTarget:self action:@selector(dismissTabBar) forControlEvents:UIControlEventTouchUpInside];

    UIButton *button3 = [UIButton buttonWithType:UIButtonTypeCustom];
    button3.frame = CGRectMake(0.0f, 0.0f, backImage.size.width, backImage.size.height);
    [button3 setImage:backImage forState:UIControlStateNormal];
    [button3 addTarget:self action:@selector(dismissTabBar) forControlEvents:UIControlEventTouchUpInside];

    //------------************TABS**************-------------------
    //-------------------------------------------------------------

    //---------------Declare View Controllers-----------
    //---------------------------TAB 1
    UIViewController *blueController = [[UIViewController alloc] initWithNibName:nil bundle:nil];
    blueController.title = @"Blue";
    blueController.tabBarItem.image = [UIImage imageNamed:@"tabBar1.png"];
    //---Add tabs & Tab names
    [blueController.view addSubview:button];
    blueController.view.backgroundColor = [UIColor whiteColor];
    blueController.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"mainMenuBKG.png"]];   


    //----TAB 2
    UIViewController *redController = [[UIViewController alloc] initWithNibName:nil bundle:nil];
    redController.view.backgroundColor = [UIColor grayColor];
    redController.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"shouldersImage1.png"]];    



    //----TAB 3
    UIViewController *greenController = [[UIViewController alloc] initWithNibName:nil bundle:nil];
    greenController.view.backgroundColor = [UIColor greenColor];
    //--------------------------------------------------


    //---Instantiate tab bars

    tbc = [[UITabBarController alloc] initWithNibName:nil bundle:nil];

    //---Create array of tabs
    tbc.viewControllers = [NSArray arrayWithObjects:blueController, redController, greenController, nil];

    //---Select starting tab
    tbc.selectedViewController = blueController;

    //--------------------------------------------------


    //---Add tabs & Tab names

    [redController.view addSubview:button2];
    redController.title = @"Red";

    [greenController.view addSubview:button3];
    greenController.title = @"Green";


    //---Release Tab views
    [blueController release];
    [redController release];
    [greenController release];
    [self presentModalViewController:tbc animated:YES];


}

//---Code to dismiss Tab Bars
- (void)dismissTabBar {
    [self dismissModalViewControllerAnimated:YES];
    [tbc release];
}


/*
// The designated initializer. Override to perform setup that is required before the view is loaded.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}
*/

/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/


/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
}
*/


/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}


- (void)dealloc {
    [super dealloc];
}

@end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T05:41:03+00:00Added an answer on May 21, 2026 at 5:41 am

    Your question is too general to illicit a good answer, but I’ll try to point you in the right direction.

    You do not have to create a separate .h/.m/.xib for each button – you probably want that main menu page with all the buttons to be controlled by a single view controller class (.h, .m) and it would probably be convenient to create all the buttons in a single .xib file.

    The views you create for each button’s action depends on what you want it to do. If 3 of them just show an image, you could re-use a class called displayImageView, for example.

    I suggest you get your app working with a single main view with a single button and action, and then figure out how to expand it to 8 or 9 actions.

    And finally, I think you have a lot of reading to do. Here is a good place to start. Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I'm trying to create an if statement in PHP that prevents a single post
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.