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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:43:15+00:00 2026-05-20T10:43:15+00:00

When should I use the nonatomic , retain , readonly and readwrite properties in

  • 0

When should I use the nonatomic, retain, readonly and readwrite properties in Objective-C?

For example:

@property(nonatomic, retain) NSObject *myObject;

If I use nonatomic and retain, does this mean that the object will be retained?

  • 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-20T10:43:16+00:00Added an answer on May 20, 2026 at 10:43 am

    First off, I wanted to promote the comment from David Gelhar to a full answer. The modifiers atomic and nonatomic have nothing to do with thread safety. See this question for more detail in that space.

    The other items you listed can be addressed relatively simply. I’ll hit them briefly and point you toward the documentation on property modifiers if you want more.

    atomic vs nonatomic primarily ensures that complete values are returned from synthesized getters and that complete values are written by synthesized setters.

    readwrite vs readonly determines whether a synthesized property has a synthesized accessor or not (readwrite has a setter and is the default, readonly does not).

    assign vs retain vs copy determines how the synthesized accessors interact with the Objective-C memory management scheme. assign is the default and simply performs a variable assignment. retain specifies the new value should be sent -retain on assignment and the old value sent -release. copy specifies the new value should be sent -copy on assignment and the old value sent -release.

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

Sidebar

Related Questions

If I have a property like this: @property (nonatomic, retain) UILabel* lblUsername; Should I
i have this code in my .h: @property (nonatomic, retain) NSArray *arrayData; What is
I don't know which title I should use for this question. I have a
I have 2 classes that inherit UITableViewControllers. And this two table views should use
I have 2 questions about how to make a correct readonly property in Objective-C
First I read this article I think I should use "copy" in my programe.
In almost all my classes I use properties and I always use retain properties
I want to compare the following simple assignments: ... @property(nonatomic,retain) UITextField *textField; ... self.textField.text
I have the following variable defined: @property (nonatomic, retain) NSMutableArray *arraySpeechSentences; And I am
@interface{ NSArray *array; } @property (nonatomic, retain) NSArray *array; @end @implementation @synthesize array; self.array

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.