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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:46:59+00:00 2026-06-04T01:46:59+00:00

It is casually mentioned here that instance variables have __strong enabled per default –

  • 0

It is casually mentioned here that instance variables have __strong enabled per default – does this mean that having this:

@interface Foo {
    Bar *test; // implicitly __strong
}
@property (nonatomic, unsafe_unretained) Bar *test;
@end

and calling

test = [[Bar alloc] init];

in the implementation file, that the new Bar instance will be retained? If yes, will the Bar instance be released at all when Foo is deallocated, considering that the property tells ARC to not touch it?

  • 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-04T01:47:02+00:00Added an answer on June 4, 2026 at 1:47 am

    Did you try compiling that? It won’t work. The ivar associated with a property has to have the same ownership qualifier as the property. This is in the Clang ARC doc:

    If the associated instance variable already exists, then its ownership qualification must equal the ownership of the property; otherwise, the instance variable is created with that ownership qualification.

    @interface Digby : NSObject 
    {
        NSString * wiska;
    }
    
    @property (unsafe_unretained) NSString * wiska;
    
    @end
    
    @implementation Digby
    
    @synthesize wiska;    // Existing ivar 'wiska' for property 'wiska' with unsafe_unretained attribute must be __unsafe_unretained
    
    @end
    

    If you remove the explicit ivar declaration, then the synthesized ivar will be __unsafe_unretained, like the property.

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

Sidebar

Related Questions

I've been casually programming in Java for a while, but I still have a
This situation probably is not entirely uncommon to some of you: you have some
Does System.Activator.CreateInstance(T) method have performance issues (since I'm suspecting it uses reflection) big enough
I have a body of text that I have to scan and each line
I have a String to Brush converter that I use in WPF to color
I have a C/C++ programming background, and while casually learning Javascript through the @3C
I've spent some time casually mulling over ACLs in my head. I can see
I know this question has been asked a couple of times, but there's something
Under a bare bones setup for SVN on windows (without using VisualSVN), as per
My team has inherited support for 100+ applications. The applications don't have any kind

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.