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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:41:15+00:00 2026-06-11T18:41:15+00:00

Does Xcode 4.5 have a slightly different manner of auto-generating properties and their associated

  • 0

Does Xcode 4.5 have a slightly different manner of auto-generating properties and their associated memory release sections (in dealloc and viewDidUnload)?

I upgraded to Xcode 4.5 from 4.5 Beta 1 yesterday. Now when I use Interface Builder to create an outlet (by Ctrl-dragging from, say, a UILabel to the associated header file), it creates the @property declaration in the header as normal:

@property (retain, nonatomic) IBOutlet UILabel *propertyName;

However, in the associated .m file, there is no @synthesize declaration.

The code in viewDidUnload is normal:

- (void)viewDidUnload {
    [self setPropertyName:nil];
    [super viewDidUnload];
}

However, the code in dealloc prepends an _ on the property name:

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

This also means I cannot reference the property as normal ([propertyName doSomething];)

Did something change? Or did I accidentally coincidentally change some setting?

  • 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-11T18:41:16+00:00Added an answer on June 11, 2026 at 6:41 pm

    Yes, the behavior has changed slightly in Xcode 4.5.

    … in the associated .m file, there is no @synthesize declaration.

    In Xcode 4.5, the @synthesize statement is now optional, and properties are synthesized automatically. Automatically generated IBOutlet properties therefore no longer add @synthesize because it’s no longer required.

    … the code in dealloc prepends an _ on the property name

    When properties are synthesized automatically (without an explicit @synthesize statement) the corresponding instance variable is prepended with an underscore. That’s why it shows up as such in your dealloc method. This is so the instance variable and property names don’t overlap.

    This also means I cannot reference the property as normal

    No. Accessing instance variables and properties has not changed. All that has changed is the default name of the instance variable. E.g.:

    _foo = @"Bar"; // Setting an instance variable directly.
    self.foo = @"Bar";  // Setting an instance variable via a property accessor method.
    

    The underscore is merely a matter of style, so that it’s more clear that you’re accessing the instance variable rather than the property.

    Note that you can add a @synthesize statement yourself, and that will force the name of the corresponding instance variable to be whatever you want it to be. Likewise, if you add your own property accessor methods then that will prevent the instance variable from being generated automatically.

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

Sidebar

Related Questions

Does anybody have an Xcode script for generating @property and @synthsize directives for instance
Does anybody have an experiencing with refactoring a project built with Xcode 4.3 down
I have this strange issue. Xcode target does not find my 3rd party mac
Does Xcode have a watch window for variables? It has a window for local
Does XCode 4 have keyboard shortcut for the two menu options: Edit > Find
Does Xcode 4 have support for rails projects? If so, to what extent? UPDATE
Does xcode 4.2 have the following toolbar or view or window with the build,
I have a simple question: does Xcode 3.2.4 work on Mac OS X Leopard
Does anyone have a good pre-rolled gitignore file for iPhone development using Xcode and
Does Xcode support tail-call optimization on the iPhone?

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.