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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:44:54+00:00 2026-06-08T18:44:54+00:00

So I use the @property key in my header file. If I do that,

  • 0

So I use the @property key in my header file.

If I do that, I should use the @synthesize key in my implementation, right? But I wonder, is there an actual reason I have to do that? I’m just wondering why isn’t writing @property in the header just about enough for the to code know my intentions (having the get/set methods automagically generated).

Sure, according to Why we have to synthesize? we write @synthesize to generate the get/set methods. But my question is about why isn’t @property in the header just enough for this?
I ask because whenever I write @property in my header, I immediately go to the implementation and write @synthesize. So for me, the only reason @synthesize is used is to complement the @property keyword. Which seems rather redundant, and makes me assume that @synthesize wouldn’t exist if it wasn’t because it has other uses. What are those other uses?

  • 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-08T18:44:59+00:00Added an answer on June 8, 2026 at 6:44 pm

    @synthesize does two things. It generates the getter/setter pair and it creates the iVar for the property.

    Of these two things, I think the iVar creation is the key to when I use @synthesize and when I don’t. When create properties for members that are not internally stored as iVars, then (obviously) I don’t use @synthesize.

    The upcoming auto synthesize feature is not going to be of much help. I always name my iVars with a leading ‘_’, and so I will still need to explicitly synthesize them.

    See @AndrewMadsen link: it looks like ‘_’ prefix auto synthesize will generate the iVars.

    W00t! Needless to say, I’m much more excited about auto synthesize now!!

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

Sidebar

Related Questions

I'm want to use RedirectAttibutes property that has come up in Spring 3.1, I
I have a bunch of third-party Java classes that use different property names for
I'm trying to use a border property on a div that is using a
Is there any way to find the key that corresponds to a given item
I'm having trouble with something that (I think) should be simple, but can't find
I would like to use an objects property as the key for a dictionary.
I know that model should not be aware of session data but I have
In my Asp.Net project I wanna use Property Auto-wiring, e.g. for my ILogger. Basically
I use application property to count number of online users: Application[OnlineUsers] = (int)Application[OnlineUsers] +
Is it possible to use the property of one Spring bean to set 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.