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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:43:34+00:00 2026-06-01T05:43:34+00:00

I have a view controller that has a tableView in it. When I set

  • 0

I have a view controller that has a tableView in it. When I set the frame of it’s tableView, it appears on the screen at a different place then the frame that I gave it. For example, giving it an X coord of 200 with a width of 128 puts the whole thing off the screen.

Here is where I instantiate the view controller:

myPopover = [[PopupVC alloc] initWithFrame:CGRectMake(100, 47, 128, 150)];

And the init code for the view controller:

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
    }
    return self;
}

- (id)initWithFrame:(CGRect)_frame
{
    self = [self initWithNibName:nil bundle:nil];
    if (self)
    {
        frame = _frame;
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self.view setFrame:frame];
    staticTable = [[UITableView alloc] initWithFrame:frame style:UITableViewStylePlain];
    [self.view addSubview:staticTable];

}

Does anybody know why this is happening? When logging the frame, it says exactly what I entered, but this is obviously not the frame that is being put on the view. As another test, I made a view of the exact same dimensions which clearly showed that they are in different places. Very weird, any help is appreciated.

Thanks

  • 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-01T05:43:35+00:00Added an answer on June 1, 2026 at 5:43 am

    your

    [self.view setFrame:frame];

    (100,47) absolute coordinate

    |                |
    |                |
    |   self.view    |
    |                |
    |                |
    

    you staticTable leave zero coordinates.

    staticTable = [[UITableView alloc] initWithFrame:CGRectMake(0,0,128,150) style:UITableViewStylePlain];
    

    because

    (0,0) relative coordinate for self.view.

    (100,47) absolute coordinate for superView

    self.view
        |[                ]|
        |[                ]|
        |[staticTableView ]|
        |[                ]|
        |[                ]|
    

    If you set the frame is equal to the image below.

    staticTable = [[UITableView alloc] initWithFrame:frame style:UITableViewStylePlain];
    

    self.view
     |      [      |         ]
     |      [      |         ]
     |      [static|TableView]
     |      [      |         ]
     |      [      |         ]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a view controller class that has to implement several protocols. Too keep
I have the problem that my view controller class has too many delegates and
I'm making an application for the iPad. I have a view controll that has
I have a view controller that gets presented modally and changes some data that
I know this is extremely silly. I have a view controller that scans a
In a word, how? I have a view controller that creates a few custom
I have a modal view controller that I am presenting on iPad via: vc.modalPresentationStyle
I have a few methods inside my view controller that load up for future
I have a navigation view with a cell that has something as simple as
I have an app I am working on, that has a table view with

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.