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 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

Related Questions

I am building an iPhone app that contains medical information for medical professionals. The
Experienced with Rails / ActiveRecord 2.1.1 You create a first version with (for example)
I'm a pretty experienced Java programmer that's been doing quite a bit of Win32
I've seen the Testing iPhone app with limited network access ( link ) question,
I'm more than halfway through development of my first iPhone game and I'm currently
I'm not that experienced with databases. If I have a database table containing a
I'm an experienced client application developer (C++/C#), but need to come up to speed
Our team is experienced in web development (tomcat/Oracle) but not with AJAX on our
I've experienced rather strange behavior of JSTL forEach tag. I have some bean called
I'm a pretty experienced Grails developer, but most of my experience has been 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.