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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:29:48+00:00 2026-05-15T23:29:48+00:00

I recently tried to compile an older Xcode project (which used to compile just

  • 0

I recently tried to compile an older Xcode project (which used to compile just fine), and now I’m seeing a lot of errors of this form:

error: writable atomic property 'someProperty' cannot pair a synthesized setter/getter with a user defined setter/getter

The code pattern which causes these errors always looks like this:

// Interface:

@property (retain) NSObject * someProperty;

// Implementation:

@synthesize someProperty; // to provide the getter
- (void)setSomeProperty:(NSObject *)newValue
{
    //..
}

I can see why the error is being generated. I tell the compiler to synthesize my property accessors (both getter and setter), and then immediately afterward I override the setter manually. That code has always smelled a little off.

So, what is the proper way to do this? If I use @dynamic instead of @synthesize, I will have to write the getter as well. Is that the only way?

  • 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-15T23:29:49+00:00Added an answer on May 15, 2026 at 11:29 pm

    I had the same problem and after doing a bit of research, here is my conclusion about this issue:

    The compiler warns you about a @property that you declared as atomic (i.e. by omitting the nonatomic keyword), yet you provide an incomplete implementation of how to synchronize access to that property.

    To make that warning disappear:

    If you declare a @property to be atomic then do one of the following:

    • use @dynamic or;
    • use @synthesize and keep the synthesized setter and getter or;
    • provide a manual implementation of both the setter and the getter (without using one of the above directives).

    If you declare the @property with (nonatomic) then you can mix manual and synthesized implementations of getters and setters.

    Update: A Note on Property Auto-Synthesis

    As of LLVM 4.0, CLang provides auto-synthesis for declared properties that are not @dynamic. By default, even if you leave out the @synthesize, the compiler will provide getter and setter methods for you. However, the rule for atomic properties is still the same: Either let the compiler provide both the getter and the setter, OR implement them both yourself!

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

Sidebar

Related Questions

recently I downloaded this open source project and I am trying to compile it.
I have a project using DevExpress 8.3 (2008.3) which I just recently upgraded to
I recently tried to combine SEAM and GWT in a project - but failed
Recently I tried to explain some poorly designed code to my project manager. All
Recently I tried compiling program something like this with GCC: int f(int i){ if(i<0){
Recently I've come across a problem in my project. I normally compile it in
Recently I downloaded Live555 server source code from their site. I tried to compile
Recently I tried to compile and install ns-2 , a network simulator based on
I've recently tried operator overloading, and have looked at this stackoverflow page (http://stackoverflow.com/questions/4421706/operator-overloading) about
I just recently found out how to add an icon to a win32 project

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.