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

  • Home
  • SEARCH
  • 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 6062505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:03:36+00:00 2026-05-23T09:03:36+00:00

Well ! I got confused about the way of declaring variables & implementing its

  • 0

Well ! I got confused about the way of declaring variables & implementing its properties.

The .h File contents

@interface XYZAppDelegate : NSObject <UIApplicationDelegate> {

}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet XYZViewController *viewController;
@end

The .m File Contents

#import "XYZAppDelegate.h"
#import "XYZViewController.h"
@implementation XYZAppDelegate
@synthesize window=_window;
@synthesize viewController=_viewController;

My questions/Queries are as follows.

  • Don’t we require to declare variables if we put property ? ( Using property, we can indirectly declare variable – is it like that ? )
  • What are the additional features other than this ? ( In coding specific )
  • Why does everybody insist to use _ before each property accessor ? ( Other than security threats ? Has it become coding standard ? Whats the reason behind it? )
  • 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-23T09:03:36+00:00Added an answer on May 23, 2026 at 9:03 am
    • You do not have to declare the
      variable. It is done automatically,
      I believe by @synthesize. One
      advantage to declaring it is that the
      debugger will automatically list it.
      Weigh this against the ugliness of
      redundant definition.
    • Other features: read only properties,
      assigned (unretained) values.
    • The underscore is a convention for
      naming member variables that are
      differently named than properties and
      method variables. Apple’s samples
      sometimes use this convention and
      sometimes do not. I view it as
      usually unnecessarily verbose as a
      programmer can easily tell the
      difference between myVariable and
      self.myVariable.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well, i've got a nice WPF book its called Sams Windows Presentation Foundation Unleashed.
I was going through The Well Grounded Rubyist and got confused by the following
Well, I'm working on sequence diagram and I got confused when I found a
I got this code from someone and it works very well, I just want
I've got an after insert trigger that works well. However, I want it to
Well, now that I've finally got my stupid ODBC stuff configured, I took a
I've got a flex component which works pretty well but unfortunately turns into a
i've got regex which was alright, but as it camed out doesn't work well
I've got to develop a multi-language code generator in C#. Well actually the idea
I've got Wordpress 2.5 installed on my website. It works well, but I can't

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.