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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:06:50+00:00 2026-05-20T14:06:50+00:00

What is the nce between accessing a property via propertyname versus self.propertyname in objective-c?

  • 0

What is the nce between accessing a property via “propertyname” versus “self.propertyname” in objective-c? Can you cover in the answer:

  1. What is best practice?
  2. How do the two approaches affect memory management (retain counts / one’s responsibilities for memory management)
  3. Any other advantages/disadvantages

The assumption for the scenario could be based on the following:

Header file

@interface AppointmentListController : UITableViewController {
    UIFont *uiFont;
}
@property (nonatomic, retain) UIFont *uiFont;

Implementation

- (void)viewDidLoad {
    [super viewDidLoad];  

    uiFont = [UIFont systemFontOfSize:14.0];
    //VERSUS
    self.uiFont = [UIFont systemFontOfSize:14.0];

thanks

  • 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-20T14:06:50+00:00Added an answer on May 20, 2026 at 2:06 pm

    Using propertyname just accesses the instance variable. You’re responsible for doing your own memory management on its contents; no retains or releases are performed for you.

    Using self.propertyname generally uses an accessor. If you’re using @synthesize, the generated accessors will handle memory management as specified in your @property line (the example you gave uses retain, so a retain will be performed on setting a new value to self.propertyname). You can also write your own accessor methods that do management as you like.

    A fuller explanation is in the Memory Management Programming Guide. Best practices in this case are generally to use @property and @synthesize to handle your variables, then use the self.propertyname accessors to reduce the memory management burden on yourself. The guide also recommends you avoid implementing custom accessors (i.e. using @property without @synthesize).

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

Sidebar

Related Questions

Working with the Location Manager in Android, nce you first call the requestLocationUpdates, the
I'm using the zRSSFeed jQuery plugin in a web part to read in two
Is there a fastest way to compare two strings (using the space for a
Normally pages that have a login form can be downloaded with wget --no-check-certificate --save-cookies
My SQL SELECT nce.id, nce.send, count( * ) AS total FROM `newsletter_email` nce WHERE
I am getting the following error when retrieving data from a rest data source
I have several (more than 20) methods ( getXXX() ) that may throw an
We have been asked to set up a backdoor in a victim machine for
I have error from visual studio 2010: Error 1 The item CrossDomainService.svc.cs was specified
I have a workbook where several of my data feeds pass a parameter back

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.