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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:00:43+00:00 2026-05-15T12:00:43+00:00

Are there side-effects to calling a custom getter with dot notation? I had been

  • 0

Are there side-effects to calling a custom getter with dot notation?

I had been using a synthesized getter in Objective-C via the dot notation, i.e.

tree.fruitnumber

returned the number of fruits in tree. I had to customize the getter (for reasons not pertinent to this question). I wrote it as

-(int) fruitnumber
{
   //climb into tree and hand count fruits. Get n;
   return n;
}

Suprisingly, the dotted getter still works. Is this legit, or there is a nasty bug (which will infect all my fruits down the road (to the market?)).

  • 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-15T12:00:44+00:00Added an answer on May 15, 2026 at 12:00 pm

    Dot notation is really just syntactic-sugar for bracket notation. So both messages are the same:

    int x = [self fruitNumber];
    int x = self.fruitNumber;
    

    The nice thing is, you can @synthesize your properties and the setter/getter methods will be built for you (depending on your property options, of course) but you can write your own instead and they will be used.

    In the case where you are providing your own setters/getters, you can alternatively use the @dynamic propertyName line instead of @synthesize to tell the compiler these are being provided by you.

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

Sidebar

Related Questions

I tried extending native Objects using operators. It works. Would there be side effects
I was wondering if there are any SEO side effects if I put my
Is there a decent way to simulate server side includes using Python on Google
Are there any side effects to changing a class hierarchy's ancestor from TObject to
There are two intents on the receiver side which are called from the same
There are plenty of options for powerful server side languages, but I can't think
There's a strange requirement where I need to get server side data on page
Is there a way to store values on client side permanently? I have a
Are there any UI widgets available to the python side of Google App Engine?
Are there are any rules for when to use Client-Side validation and when to

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.