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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:25:08+00:00 2026-05-28T08:25:08+00:00

There are two new memory management attributes for properties introduced by ARC, strong and

  • 0

There are two new memory management attributes for properties introduced by ARC, strong and weak.

Apart from copy, which is obviously something completely different, are there any differences between strong vs retain and weak vs assign?

From my understanding, the only difference here is that weak will assign nil to the pointer, while assign won’t, which means the program will crash when I send a message to the pointer once it’s been released. But if I use weak, this won’t ever happen, because message send to nil won’t do anything.

I don’t know about any differences between strong and retain.

Is there any reason why should I use assign and retain in new projects, or are the kind of being deprecated?

  • 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-28T08:25:08+00:00Added an answer on May 28, 2026 at 8:25 am

    From the Transitioning to ARC Release Notes (the example in the section on property attributes).

    // The following declaration is a synonym for: @property(retain) MyClass *myObject;
    
    @property(strong) MyClass *myObject;
    

    So strong is the same as retain in a property declaration.

    For ARC projects I would use strong instead of retain, I would use assign for C primitive properties and weak for weak references to Objective-C objects.

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

Sidebar

Related Questions

I was just wondering if there is any difference between the two different new
We're creating a new consumer/public-facing ASP.Net web app. There are two concerns: --Use cookie
In the upcoming Java7, there is a new API to check if two file
I have seen resources show two ways of allocating memory while ensuring that there
I'm new to Objective-C, and I've read some memory management articles but am having
Are these two constructs equivalent? char[] arr = new char[5]; for (char x :
I have these two modules : package G1; sub new { my $class =
Let's say I have these two arrays: string[] arr1 = new string[2]{Hello, Stack} string[]
What are the differences between these two codes in JavaScript? var obj = new
Being new to VS, how may I think of these two concepts, what is

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.