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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:50:32+00:00 2026-05-11T21:50:32+00:00

I need to understand how NSView autoresizes it’s views. I’ve set everything up in

  • 0

I need to understand how NSView autoresizes it’s views. I’ve set everything up in IB and my subviews resize nicely (when I resize my window around with a mouse). However, if I do [myMainView setFrame:] with my new frame rect, nothing happens. All of my sub-views are still the original size (even though the main view has the correct dimensions). Child’s resizeWithOldSuperviewSize: gets called, but it’s still not appropriately sized.

I have a screen-full of cocoa elements on screen (screen #1), label, image, video. There’s a well-defined layout for these elements. I’ve setup autoresizing behavior via Interface Builder that works very well. Resizing the main window resizes the elements in a satisfying manner.

Now, the user clicks the “next” button, whereupon a second screenfull of elements (screen #2) is to be drawn. My layouts are built based on a canonical screensize (say, 800×600). But now the window is larger (or smaller) because it was resized in screen #1. So the elements are now only taking a small area in the window, instead of being appropriately sized to fill the available space. I want to scale these elements.

Am I misunderstanding how autoresizing works? How can I trigger the autoresize machinery underneath NSView manually?

There are two things I can do:

  1. Manually resize the elements based on the current screen size relative to original size. This option is not my favorite because seemingly, I’m forced to rewrite the code that’s already working in NSView (the autoresizing behavior
  2. My second option is to invoke the aforementioned NSView’s autoresizing magic. Documentation implies that [NSView setFrame:] will do that for me. What I’ve tried was, resize my content view to the original screensize (800×600), render my elements and then resize it to the current window size. Conceptually, is it not identical to manually resizing the window? It appears not to be. Again, this option is preferable because it minimizes the amount of code that has te be written and maintained.
  • 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-11T21:50:33+00:00Added an answer on May 11, 2026 at 9:50 pm

    Turns out my approach is correct. I was setting the frame size to an incorrect value, thus I wasn’t getting the expected behavior. Doh.

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

Sidebar

Ask A Question

Stats

  • Questions 124k
  • Answers 124k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Are you running on OS 3.0? I saw the same… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer It looks like you need to register Apache::Session::Memcached with Apache::Session::Wrapper,… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer Use DATENAME or DATEPART: SELECT DATENAME(dw,GETDATE()) -- Friday SELECT DATEPART(dw,GETDATE())… May 12, 2026 at 1:19 am

Related Questions

I need to understand how NSView autoresizes it's views. I've set everything up in
I have a problem to understand how to use IoC in a scenario where
I need to pad numbers with leading zeros (total 8 digits) for display. I'm
could some one help me out trying to understand how hard drive seeking works.
For years and years, I've tried to understand the part of Java specification that

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.