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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:03:22+00:00 2026-06-12T17:03:22+00:00

I have an xib file includes a UIView and a UIScrollView. Inside my UIView,

  • 0

I have an xib file includes a UIView and a UIScrollView.

Inside my UIView, I have another UIView (the while screen in the middle), and I want to add my scrollView to it programmatically.

The reason is one time I want to add a scrollView there and another time I want to add a mapView.

What I did is like this:

CGRect frame = self.view.bounds;
    self.scrollView = [[UIScrollView alloc] initWithFrame: frame];
    CGSize pagesScrollViewSize = self.view.frame.size;
    self.scrollView.contentSize = CGSizeMake(pagesScrollViewSize.width * self.pageImages.count, pagesScrollViewSize.height);

I also need to set the delegate for the UIScrollView.

I could not make it work. this is my error:

-[UIScrollView setPageId:]: unrecognized selector sent to instance 0x7dd84e0
2012-10-06 00:56:17.373 testN[3525:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIScrollView setPageId:]: unrecognized selector sent to instance 0x7dd84e0'

I also don’t know where should I connect the scrollView delegate. can you help me?

  • 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-06-12T17:03:24+00:00Added an answer on June 12, 2026 at 5:03 pm

    I can do that successfully by adding a UIScrollView in the interface builder and then set the delegate and file owner from there.

    I just should note that since I want to add the UIView to a ViewController in storyboard this code will not work:

    NSArray *views = [[NSBundle mainBundle] loadNibNamed:@"OfferView" owner:self options:nil];
    UIView *newPageView = [views lastObject];
    

    I should use:

    UIView *newPageView = [views objectAtIndex:0];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a XIB file with UIControl and UIScrollView elements inside of it. I
In my xib file I have some View. And I have PainView class (UIView).
I have a xib-file with a small UIView on it, which in turn contains
I have a UIViewController in storyboard that includes a scrollView. I want to put
I have a .xib file containing a UIView and 2 UILabel subviews linked to
I have basic *.xib file, which have NSView. How can I use another nib
I have a table view which loads another xib file and uses the content
I have a XIB file with a UITextView, which I'm associating with a UITextView*
I have a XIB file with my controls in it, loaded in the Interface
I have created a custom view with a XIB file and are loading the

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.