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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:18:49+00:00 2026-05-28T19:18:49+00:00

I understand what read and write do when used as a properties but I’m

  • 0

I understand what read and write do when used as a properties but I’m confused with the rest.

  • What is nonatomic and what is it used for?
  • What is retain and what is it used for?
  • Why is copy used? Wouldn’t it be equivalent to “read” since read also returns the value of the variables?
  • What is assign used for? Wouldn’t it be equivalent to “write” since both set copies of the variable?
  • Properties basically create getter and setter functions. Do they however create actual functions or do I just access the variable as in [class variable]? (instead of [class getVariable] or [class setVariable:int variable]. If I am just directly accessing the variable isn’t this the equivalent of making the variable public?
  • 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-28T19:18:51+00:00Added an answer on May 28, 2026 at 7:18 pm

    You need to know which flags are alternatives to each other:

    • nonatomic is in a group by itself
    • retain, copy, assign
    • readonly, readwrite

    By default, getters and setters are thread-safe which also incurs a performance penalty. nonatomic tells the compiler to not worry about thread-safety considerations when writing getters and setters for that property. It will be faster, and should be preferred if you will only access that property from a given thread, usually the main thread.

    assign tells the compiler to generate a setter that does not retain the new value. You should use it for primitive properties (int, BOOL, etc). copy creates a new copy of the object when it is assigned. retain calls [newValue retain] on the new value of the object and [oldValue release] on the old value of the object in the setter.

    For completeness, readonly tells the compiler to only generate a getter, not a setter, whereas readwrite generates both.

    When you access the variable using [class variable], you are calling a function with the same name as the property. This lets you implement the getter or setter at a future point with your own implementation, without having to modify your code in numerous other places.

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

Sidebar

Related Questions

I read the SDK document, but can not understand some details, need some help.
I've read about fork and from what I understand, the process is cloned but
I read the JVM specification for the fpstrict modifier but still don't fully understand
I have heard/read the term but don't quite understand what it means. When should
I've read a couple of things about MVCs but I still don't understand when
#I used to have this, but I don't want to write to the disk
I understand the volatile keyword in Java can make the read/write operations of reference
I read various stuff on this and understand the principle and concepts involved, however,
I have read the documentation on this and I think I understand. An AutoResetEvent
I have read about session fixation and from what I understand it forces a

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.