Reputation: 433
I want to change the background color of a view within the view controller. Selecting the view and opening the attributes inspector isn't showing that much. Should have an option here for the background.
Tried coding it within the (void)viewDidLoad{}
with: self.view.backgroundColor = [NSColor blueColor];
That isn't working either, no object of NSView.
What am I doing wrong? I read that the coding problem probably has something to with the newer version of Xcode. coding issue
Upvotes: 1
Views: 403
Reputation: 521
This is already questioned and answered in Best way to change the background color for an NSView
Here the code for OS X
[self.view setWantsLayer:YES];
[self.view.layer setBackgroundColor:[[NSColor whiteColor] CGColor]];
Upvotes: 1
Reputation: 1387
wich xcode version are you using? This is how I change the backgroun color using the attributes inspector in Version 7.1 (7B91b)
Upvotes: 0