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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:41:29+00:00 2026-06-10T14:41:29+00:00

For efficiency I want to access the member variable associated with a property in

  • 0

For efficiency I want to access the member variable associated with a property in a subclass. If I have a property declared like:

@interface Mumbo : NSObject
    @property (nonatomic) GLKVector3 position;
@end

In the implementation of Mumbo I can refer to position either as self.position or directly as _position (the default synthesized member variable – I am not using @synthesize). I use the latter for efficiency in some cases to avoid copying structures.

However, in subclasses I cannot refer to _position unless I change the interface to

@interface Mumbo : NSObject {
    GLKVector3 _position;
}
    @property (nonatomic) GLKVector3 position;
@end

This seems to work. However, am I guaranteed that the automatically synthesized member variable will coincide with the one that I’ve explicitly declared in the braces? I can’t find any definitive documentation on the subject.

  • 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-10T14:41:31+00:00Added an answer on June 10, 2026 at 2:41 pm

    Auto-synthesized variables use a leading underscore be default, so you are right there.

    But the way you declare your iVar – makes it public, but auto-synthesized variables are private. Which is why you can access it from outside the class.

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

Sidebar

Related Questions

I have a best practice/efficiency/performance issue. If I want to have a profile page
I want to create an application like this: http://collabedit.com/ What is the most efficient
Currently I'm just using something like this in the DB Table: access: home,register,login And
If I have a class with 5 member variables, e.g., class XYZ { public:
I want my Access (2007) application to read the information in the different worksheets
I have an array like array ( array 0 ('item1'=>1,'item2'=>3))....etc like so. And I
What I want is something similar to STL vector when it comes to access
I have a postgresql (v8.4) table with login id and timestamps, and I want
For my project I want to access the data from as many bug- and
Is it more efficient to access an array each time I use a variable,

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.