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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:59:51+00:00 2026-05-26T15:59:51+00:00

If I declare a property strong, like so: @property (strong, nonatomic) UIView *iVar; When

  • 0
  1. If I declare a property strong, like so:

    @property (strong, nonatomic) UIView *iVar;
    

    When I’m setting it, does it matter if I do iVar = ... or self.iVar = ...? It seems that with ARC, they do the same thing.

  2. If I only declare the instance variable (not the @property), e.g., BOOL selected, does that mean it’s inferred to be __unsafe_unretained (since there’s no property specifying it to be strong), or must I explicitly specify that?

It seems like I may have answered my own questions above in answering ARC: How to release static variable?, but I’m still slightly confused on the above questions.

  • 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-26T15:59:51+00:00Added an answer on May 26, 2026 at 3:59 pm

    From a memory management perspective, using ivar = ... or self.property = ... (note: there’s no such thing as self.ivar) are the same. However, using ivar = ... doesn’t invoke the setter while self.property = ... does. This has 3 important ramifications, in no particular order:

    1. If the property is not marked nonatomic, then access to the underlying ivar will not take the lock and you will be breaking the atomicity implications.
    2. If the property is overridden, either by you or by a subclass, the overridden setter will not be invoked.
    3. KVO notifications will not be sent.

    As for only declaring the ivar, it has the same memory management semantics as declaring a local variable. This is documented in section 4.4 of the Objective-C Automatic Reference Counting document, but basically, if it’s an object, it will be inferred to be __strong.

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

Sidebar

Related Questions

Using ARC, I have a declared property of the following form: @property (nonatomic, strong)
I'd like to declare both XmlAttributeAttribute and XmlElementAttribute on a property so that the
I think the question is self explanatory. If I declare a property of a
I Like .NET automatic properties, in C# it so easy to declare readonly property
I have an object that has a KeyValuePair type property. I would like to
I've declared a string in my header file like so: @property (nonatomic, retain) NSString
I have a string property on an entity that I would like to mark
When I declare a property without a storage specification + instance variable, everything works
In C# 3.0, I'm doing the code below to declare a DateTime property and
I want to declare three properties in my MSBuild file and overwrite one property

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.