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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:16:37+00:00 2026-05-16T20:16:37+00:00

I know that you use @synthesize to create setter and getter methods, which makes

  • 0

I know that you use @synthesize to create setter and getter methods, which makes things easier because then you don’t have to write your own.

There are certain places where you have to use self.property instead of just property in order to make use of the setter and getter methods, such as in dealloc and initWithCoder.

This tells me that these setter and getter methods are doing something else that’s important, besides making it easier for you to set and get a variable. What are they doing and how do they do 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-16T20:16:38+00:00Added an answer on May 16, 2026 at 8:16 pm

    They’re doing whatever you told them to do in the @property statement or your own implementation, if you chose to write one. Most often, the reason for using the accessors rather than directly modifying instance variables is to avoid memory leaks. Imagine an NSString instance variable declared with

    @property (nonatomic, retain) NSString *myString;
    @synthesize myString;
    

    These lines generate an accessor that correctly calls release and retain when you want to change the myString property of an object. If you didn’t call the accessor, you could potentially leak the old value, unless you were careful to do the memory management yourself.

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

Sidebar

Related Questions

I know that you can use a dummy int parameter on operator++ and operator--
I know that I can use $('#myId').load('aPage.html'); to load a page into an element,
I know that I have to use: rdtsc. The measured function is deterministic but
I know that I am supposed to use delete [] after I use new
We know that a single application instance can use multiple cores and even multiple
I know that cursors are frowned upon and I try to avoid their use
I know that to find all the .h files I need to use: find
Is there any real use for self modifying code ? I know that they
Does anyone know any good tool that I can use to perform stress tests
Does anyone know of an algorithm that I could use to find an interesting

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.