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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:23:05+00:00 2026-05-24T01:23:05+00:00

I am trying to compile old iPhone application project using new LLVM 3.0 compiler.

  • 0

I am trying to compile old iPhone application project using new LLVM 3.0 compiler.
I am getting this error:

Automatic Reference Counting Issue: cast of C pointer type ‘CGColorRef’ (aka ‘struct CGColor *’) to Objective-C pointer type ‘id’ requires a bridged cast [4]

for code:

UIColor *color1, *color2, *color3, *color4;

....

NSArray *colors =  [NSArray arrayWithObjects:(id)color1.CGColor, color2.CGColor, color3.CGColor, nil];

This code compiles without problems in older LLVM GCC 4.2 compiler.
What is the cause of that?
What are the most important things to learn when migrating to the LLVM 3.0 compiler?

  • 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-24T01:23:06+00:00Added an answer on May 24, 2026 at 1:23 am

    This is because you’re using the compiler’s ARC mode (Automatic Reference Counting). For ARC to successfully statically track the reference count of objects that cross the toll-free bridges (Foundation to Cocoa and vice versa), you need to tell it that you’ve considered the situation. In general, either disable ARC or have a read of The ARC documentation about casts to pick the appropriate solution.

    However, here you have a bigger problem. CGColorRef (the type of UIColorInstance.CGColor) is not toll-free bridged to a Cocoa type, and so cannot be safely cast to a id. Why not just store the UIColor?

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

Sidebar

Related Questions

So I keep getting this error when trying to compile C++ code using CodeBlocks.
I'm trying to compile a little project that includes windows.h using the clang compiler.
I'm trying to compile an old project using VS express 2010 but I get
I'm trying to compile a Delphi 7 project that I've inherited, and I'm getting
I'm trying to compile an old project that was originally designed for Visual Studio
I am trying to compile and run a really really old application on my
I am trying to compile an iPhone app. The app is quite old (2.0
I am trying to compile my project in Xcode. But i am getting the
I'm trying to compile someone else's project, and I'm getting about 850 errors all
I've got yet another error trying to compile with Apple GCC 4.2.1 using the

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.