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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:06:24+00:00 2026-06-04T09:06:24+00:00

I solved my problem by using CGColorGetComponents , but I would like to understand

  • 0

I solved my problem by using CGColorGetComponents, but I would like to understand exactly what was the reason.

I was doing the following with an instance of UIColor *firstColour :

[firstColour getRed:&r green:&g blue:&b alpha:nil];

This was working perfectly fine on simulator. Then I tested it on my device, and got this error :

UIDeviceRGBColor getRed:green:blue:alpha unrecognized selector sent to instance

After some research on the Internet I found that UIColor is actually replaced by subclasses, like UIDeviceRGBColor. Fine, but shouldn’t subclasses work just like UIColor and accept (at least) the same methods ?

I enabled Zombie but apparently this wasn’t a memory management issue, like most people say on forums. And I can’t find documentation for UIDeviceRGBColor so I don’t know how it is supposed to behave. Does someone know why it happened, and above all, if this is likely to happen again with another method ?

Thank you.

  • 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-06-04T09:06:26+00:00Added an answer on June 4, 2026 at 9:06 am

    getRed:green:blue:alpha: method in UIColor is available starting iOS 5.0. Most likely the problem is that your device has older OS version where that method is not available.

    On older OS you’ll probably have to retrieve color components from underlying CGColorRef structure using CGColorGetComponents/CGColorGetNumberOfComponents functions

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

Sidebar

Related Questions

I would like to solve the following problem using constraints but i actually don't
I've just solved an interesting problem using MySQL's IN, but I don't know what
I would like to get a different solution to a problem I have solved
This is an Amazon interview Question.I have solved this problem in O(n) using dynamic
I solved Problem 10 of Project Euler with the following code, which works through
I can't see this in the docs, but I presume it's a solved problem.
I am doing shadow mapping using OpenGL. There is a z-fighting problem when comparing
Answer Summary: Solved this problem using Jon Skeet's answer below. Here is the finished
I imagine this is common enough that it's a solved problem, but being a
I though I had solved this problem, but it is back: Code generation for

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.