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

  • Home
  • SEARCH
  • 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 863369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:17:50+00:00 2026-05-15T09:17:50+00:00

I am an experienced iPhone dev beginning to work on my first Mac app.

  • 0

I am an experienced iPhone dev beginning to work on my first Mac app. One thing that is really throwing me off is the differences between UIView and NSView. It seems that I cannot set the background color of a NSView via interface builder as I can with a UIView. It also seems that I cannot do it by simply sending a setBackgroundColor: message to it. All the examples I have seen are overriding drawRect: in a subclass of NSView. Is that really the only way to do it? What is the conceptual difference here, and why is it this way? NOTE: I am only trying to set the background color to the default grey.

  • 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-15T09:17:50+00:00Added an answer on May 15, 2026 at 9:17 am

    Re: Alex’s answer:

    It’s not just that it’s older; or rather;… It isn’t that it’s older. The fact of the matter is that UIKit is simpler. UIView is a much less general construct than NSView; the general method that Apple is pushing for content-rich applications on the iPhone is using OpenGL or Core Animation, relegating UIView, by and large, to simple container stuff. In this context, setBackgroundColor: is useful.

    On the Mac, on the other hand, NSView is a highly generic interface element, and for most uses, setBackgroundColor: would just be plain unnecessary. 9 out of 10 times, if you’re on a Mac and changing the background color this is either because you are preparing to do your own drawing of user interface elements, or you are doing something that is most likely not condoned by the AHIG.

    In summary:

    There is no way apart from subclassing it. (NSView is made for subclassing, UIView is made for drop-in-and-use.)

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

Sidebar

Ask A Question

Stats

  • Questions 473k
  • Answers 473k
  • 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 Use RelayCommands instead of RoutedCommands. You can look at this… May 16, 2026 at 4:01 am
  • Editorial Team
    Editorial Team added an answer MongoDB uses its own object type MongoDate, which resembles an… May 16, 2026 at 4:00 am
  • Editorial Team
    Editorial Team added an answer Split the script in two parts - first to collect… May 16, 2026 at 4:00 am

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.