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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:00:11+00:00 2026-05-25T00:00:11+00:00

Debugger show some value in color . Please what am I doing wrong @synthesize

  • 0

Debugger show some value in color . Please what am I doing wrong

@synthesize textLabel;
@synthesize textField;
@synthesize sliderRed;
@synthesize sliderGreen;
@synthesize sliderBlue;


- (void)dealloc
{
    [textLabel release];
    [super dealloc];
}

- (IBAction)updateLabel
{
    NSString * textValue = [textField text];

    float red = [sliderRed value]/255.f;
    float green = [sliderGreen value]/255.f;
    float blue = [sliderBlue value]/255.f;

    UIColor *textColour = [[UIColor alloc]initWithRed:red green:green blue:blue alpha:1.0];
    [textLabel setText:textValue];
    [textLabel setTextColor:textColour];
}
  • 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-25T00:00:11+00:00Added an answer on May 25, 2026 at 12:00 am

    I guess sliderRed, sliderGreen and sliderBlue are UISlider instances? What are their min/max values? If you left it at default 0.0 to 1.0 then this code would give you some really low values:

    float red = [sliderRed value]/255.f;
    float green = [sliderGreen value]/255.f;
    float blue = [sliderBlue value]/255.f;
    

    UIColor’s method you use takes float parameters from 0.0 to 1.0 so simply passing it the slider values without dividing them would work.

    And don’t forget to put [textColour release]; at the end of that method or you will be leaking a new UIColor instance every time the method gets called.

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

Sidebar

Related Questions

Need some advise on what I am doing wrong during client JSON parsing... Tips
I've got thread, which processes some analytic work. private static void ThreadProc(object obj) {
I'm doing some manipulation of the mouse cursor regarding clipping areas, and to this
I'm doing some Mac development in a WebView. I want to expand URLs that
I am trying to make a debugger that will be dynamiaclly created with some
I had the debugger working in pgAdminIII at one point, some time before upgrading
My debugger keep jumping into debugging the IL instead of jumping to debug code
The debugger threw me this error UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:
My debugger is not working, I'm putting a breakpoint, but in run, time visual
Using the debugger in Netbeans 6.1, I'd like to step into a method of

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.