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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:47:54+00:00 2026-06-10T09:47:54+00:00

Recently I have started learning Objective-C, and I get puzzled about the member var

  • 0

Recently I have started learning Objective-C, and I get puzzled about the member var and property. I want to know what’s the difference between the following three code blocks:

1.

@interface Application 
{ 
    UserInfo* userInfo; 

    ApplicationInfo*applicationInfo;
}

@property (retain) UserInfo*userInfo; // @synthesize userInfo; 

@property (retain) ApplicationInfo* applicationInfo ; // @synthesize applicationInfo;

@end 

2.

@interface Application 

{ 
}

@property (retain) UserInfo*userInfo; // @synthesize userInfo; 

@property (retain) ApplicationInfo* applicationInfo ; // @synthesize applicationInfo; 

@end 

3.

 @interface Application 
{ 
    UserInfo* userInfo; 

    ApplicationInfo*applicationInfo;
} 

@end

Thank you very much!

  • 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-10T09:47:56+00:00Added an answer on June 10, 2026 at 9:47 am

    1: This declares instance variables with accompanying declared properties. When you synthesise the properties, for example the property foo, the foo and setFoo methods are automatically generated which refer to the instance variables (due to having the same name), and these are called when you use dot notation (e.g. someInstance.foo = bar) to access them. Because you defined the properties to be retain, when you assign an object to the property using the setter or through dot notation, the existing object pointed to by the instance variable is released and the new object is assigned to the instance variable and retained.

    2: Exactly the same as 1. The instance variables are implied.

    3: The instance variables are there, but the properties are not, so you won’t be able to access them through dot notation and no getter/setter methods are synthesised.

    I strongly recommend reading the official documentation on this, it’s quite clear and lays it all out in a fairly straightforward manner.

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

Sidebar

Related Questions

I just recently have started learning about the wonders of **kwargs but I've hit
Recently I have started learning python on windows. I am puzzled because the way
I have recently started learning about Software as a Service and Cloud computing. Often
I recently started learning objective-C and cocoa. I'm slowly starting to learn about memory
I just recently started learning Java. I have a question which is more about
I recently started learning about IPC and I have some issues. I wrote a
Recently I have started learning rails and was a little surprised that the default
I have recently started learning c# and have come across an issue. I'm not
I have only started learning python recently. I would still be considered a beginner.
I have only started learning Python recently. Let me explain what I am trying

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.