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 6105209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:57:09+00:00 2026-05-23T13:57:09+00:00

I have a simple view controller with a few buttons that are defined as

  • 0

I have a simple view controller with a few buttons that are defined as IBActions. I want to place them on a scroll view, basically making the whole page scrollable (let’s say they are really big buttons and I have a bunch of them). How can I do that? I tried to add those buttons, but since they are defined as IBAction it did not work.

Here is some of my code. thanks!

- (IBAction) switchFromThird : (id)sender
{
    //some action...
}

- (IBAction) BackHome : (id)sender
{
     //some action...   
}

- (void)viewDidLoad
{
     [super viewDidLoad];    

myScroll.contentSize = CGSizeMake(480, 1000);
myScroll.maximumZoomScale = 4.0;
myScroll.minimumZoomScale = 1.0;
myScroll.clipsToBounds = YES;
myScroll.delegate = self;


[myScroll addSubview:switchFromThird]; //???
[myScroll addSubview:BackHome]; //???


[myScroll release];
}
  • 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-23T13:57:10+00:00Added an answer on May 23, 2026 at 1:57 pm

    No, no, no.

    Please read this article in iOS Developer Library. You can’t add a method (function) to a view! It’s like you wanted to have a computer program in your printed document on a sheet of paper!

    You should do something like this:

    1. Write IBOutlet UIButton *BackHomeButton in your .h file.
    2. Open your .xib file.
    3. Connect the BackHomeButton outlet to your button
    4. Replace [myScroll addSubview:BackHome]; with [myScroll addSubview:BackHomeButton];.

    Then, and only then it will work. As I said: you can print only images and text, not computer programs!

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

Sidebar

Related Questions

A simple question: I have a Model-View-Controller setup, with Models accessing a SQL database.
I have a simple Django view that just returns URL parameters, but if I
I have a simple custom view that is connected via outlet to a NIB.
I have an iPhone app that shows a simple view (View 1) that has
I have a very simple Mac Cocoa app that just has a Web View
I have a navigation view with a cell that has something as simple as
So I have a simple split view that functions great except when the view
I have a very simple question. I have a view controller. In the view
I have a simple view that creates a MPMoviePlayerViewController when the user presses a
I already have a view controller with a default view and few things added

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.