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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:01:06+00:00 2026-06-11T16:01:06+00:00

In Apple’s The Objective-C Programming Language p. 18, they make a distinction between setting

  • 0

In Apple’s The Objective-C Programming Language p. 18, they make a distinction between setting a variable with self versus instance reference. e.g
myInstance.value =10;
self.value =10;
1. Would these two set different properties named value?
2. How could self work if there are several instances with properties named value?
They also assert, “If you do not use self., you access the instance variable directly.” This would mean that the accessor would not be called if you use
myInstance.value =10;
and KVO wouldn’t work. Is this true?
3. Using @Property and @Synthesize (with garbage collection), what is the proper way to set properties of different instances? And what good is the self reference?
A numeric example would help me, please.

  • 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-11T16:01:07+00:00Added an answer on June 11, 2026 at 4:01 pm

    My big problem was how an ivar and a property could be tied together when they have different names, especially with multiple ivars.
    I finally found that if name of property doesn’t match name of ivar, a new ivar is synthesized. This is accessed by self.propertyname (within object) or object.propertyname (outside of object), not the declared ivar.

    To tie disparate names of ivar and property, equate them as in
    @synthesize propertyname = ivarname.

    Thanks to

    http://blog.ablepear.com/2010/05/objective-c-tuesdays-synthesizing.html

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

Sidebar

Related Questions

Apple is doing this in a setter method for an instance variable mainSprocket: –
Apple's Threading Programming Guide states that: Although good for occasional communication between threads, you
Apple doesn't want anyone to create iPhone apps outside of the Xcode/Objective-C environment. How
Apple just released iPhone SDK 3.1.2. I was wondering wether they changed some libraries
Apple's iPod (Music) app has a slider (UISlider, I presume) with variable scrubbing speeds:
Apple Developer Reference Library has a class reference for WebPreferences I've searched SO, Dev
Apple says in the NSFetchedPropertyDescription class reference: Note, however, that unlike a playlist a
Apple is giving the example , that I could make a MyColor class for
Apple does say in the documentation about the fact that they do not want
Apple's Location Awareness Programming Guide suggest to include the location-services and possibly the gps

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.