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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:17:00+00:00 2026-06-15T21:17:00+00:00

I am listening/watching the tutorial on Paul Hegarty from the App Store. In his

  • 0

I am listening/watching the tutorial on Paul Hegarty from the App Store. In his lesson he states that you should ALWAYS synthesize your properties on the implementation file like so:

@sysnthesize example = _example;

I am also doing a apple documentation tutorial that does not synthesize properties. It also has init methods like so:

- (id)initWithName:(NSString *)name location:(NSString *)location date:(NSDate *)date
{
    self = [super init];

    if (self)
    {
        _name = name;

        _location = location;

        _date = date;

        return self;
    }

    return nil;
}

@end

Will these to interact, cancel or otherwise mess with each other if add them together like so:

@implementation BirdSighting

@synthesize name = _name;

@synthesize location = _location;

@synthesize date = _date;

- (id)initWithName:(NSString *)name location:(NSString *)location date:(NSDate *)date
{
    self = [super init];

    if (self)
    {
        _name = name;

        _location = location;

        _date = date;

        return self;
    }

    return nil;
}

@end

Thanks for the help.

  • 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-15T21:17:01+00:00Added an answer on June 15, 2026 at 9:17 pm

    Thinking of it in terms of “will these interact” is perhaps not the right mental model. The place to start is understanding what each of those lines does. So let’s consider one from each example:

    @synthesize name = _name;
    

    If a property (@property, usually in the .h) called name exists, then this does a few things:

    1. It creates two methods, called -setName: and -name, which set and get the instance variable _name
    2. If an instance variable called _name doesn’t exist, it creates one

    Now the other example:

    _name = name;
    

    This does one thing; it assigns the address of ‘name’ to the instance variable _name.

    So now that we understand what those do, let’s consider how they interact:

    1. If there’s no explicit instance variable called _name to assign to, then the second line will not compile. The first line is one way to make sure there is an instance variable of that name
    2. If you set the name property (either via dot notation or the -setName methods, it makes no difference), then that will modify the same _name instance variable, by means of the methods created by the @synthesize statement
    3. If you use _name in your code, or if you use dot notation or the -name method, it will have the value most recently assigned to it by either of these means.
    4. Doing _name = name rather than self.name = name; will NOT call the -setName: method, which means anything it does besides set (for example: retaining the argument) will not happen.

    One additional consideration:
    In very recent versions of Xcode, the compiler will automatically put the @synthesize statement in for you if you leave it out. This is a good thing (less typing, less redundancy, less things to get wrong), but it could be confusing if you’re not expecting it. For example, my point 1 above will not apply with new versions.

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

Sidebar

Related Questions

I have an Email-listening application that handles incoming mails, depending on the Bucket (or
In listening to the Stack Overflow podcast, the jab keeps coming up that "real
I was listening to the podcast about PowerShell 2.0 that Scott Hanselman did .
So I was listening to Hanselminutes Podcast 158 where Joel Spolsky mentions that Wasabi
I have two widgets listening for a MouseOutEvent. Problem is that sometimes this events
I have a user control that is listening to an event. public partial class
I got a MovieClip that is listening to mouse over and out events. Inside
I have a thread that is listening on a socket and forwarding on the
I been listening around that facebook iOS sdk is not functioning properly. Is there
Does Listening a port means a continuous polling to that port or a discrete

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.