Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Playlist Browser with Objective-C Working With Multiple View Controllers UIButton Recap

Caleb Kleveter
MOD
Caleb Kleveter
Treehouse Moderator 37,862 Points

Were do I go from here?

I'm not exactly sure what to do here:

Before we finish let’s also programmatically change the tint color of our button to something more appealing. I’ve set up a UIColor object for you to use and like last time, I want you to use the documentation or the Internet to figure out which method to use. Assign the redColor UIColor object to the tint property of the timerButton.

ViewController.h
#import "UIViewController.h"
#import "UIButton.h"

@interface ViewController : UIViewController

@property (strong, nonatomic) IBOutlet UIButton *timerButton;

@end
ViewController.m
#import "ViewController.h"

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.timerButton setTitle:@"Start!" forState:UIControlStateNormal];

    UIColor *redColor = [UIColor redColor];

    // Enter your code below!


}


@end

5 Answers

Patrick Cooney
Patrick Cooney
12,216 Points

Here is the documentation page he mentions using. You want to find the the thing that will help you set the tint color of the button. Remember that properties can be set using dot notation.

Patrick Cooney
Patrick Cooney
12,216 Points

No problem. If you're still having issues just pop back in and ask for further support.

What's the answer?

Patrick Cooney
Patrick Cooney
12,216 Points

If you follow the link I posted above it will take you right to the Apple provided documentation that will show you how to do this.

I don't want the link. I saw that on my own. This challenge is so F***d up i just want to move on already. Do you have the answer? Yes, this is a cop out, but at this point, I really don't care anymore. Thanks, if you can help me

the question is wrong, because instead of changing the background color with setBackground you have to do the following it worked for me after different lines of code i input

self.timerButton.tintColor = redColor;

Will Lam
Will Lam
7,027 Points

Ugh, these quizzes are really frustrating - while I understand their purpose.. the way they're worded is... less than ideal.

Caleb Kleveter
Caleb Kleveter
Treehouse Moderator 37,862 Points

I agree. Don't worry, the Objective-C challenges are the hard ones. All the other CCs are easy.