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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:18:00+00:00 2026-06-17T17:18:00+00:00

What is the difference between @property (nonatomic, retain) NSString *subject, *name, *kind; and @property

  • 0

What is the difference between

@property (nonatomic, retain) NSString *subject, *name, *kind;

and

@property (nonatomic, retain) NSString *subject;
@property (nonatomic, retain) NSString *name;
@property (nonatomic, retain) NSString *kind;

I think the functionality is exactly the same but the first one only saves you typing and some lines of code. I am not sure though that is why I am asking 🙂

  • 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-17T17:18:02+00:00Added an answer on June 17, 2026 at 5:18 pm
    @property (nonatomic, retain) NSString *valtOnder, *name, *soort;
    

    and

    @property (nonatomic, retain) NSString *valtOnder;
    @property (nonatomic, retain) NSString *name;
    @property (nonatomic, retain) NSString *soort;
    

    Both the way are same.

    But I prefer later one. Reason??

    If you have any typo or whatever bug, you will be pointed by compiler in exact the line having that property/variable name.

    If I write dozens of property and/or variable then I have to look for each of them, which one is root cause for error…. As I used @synthesize for quite a time, it was too difficult to find.

    So I always advised and guided others to make one line declaration of variables, properties, synthesize etc.

    I am lazy. Few think why to write same thing multiple times? Extra time and work.

    But multiple lines will be more readable. You code just once and it is read hundreds of times, so just few seconds to type some extra keywords. And thanks to all the IDEs that provide you autocomplete so nowadays this reason is nearly obsolete.

    EDIT:

    As per vikingosegundo comment,

    you should never use retain for NSString, use copy.

    For Immutable objects copy should be used not retain.

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

Sidebar

Related Questions

Line 1: First.h Line 2: @property (nonatomic, retain) NSString *name; Line 3: First.m Line
what's the difference between these retains?: @property (nonatomic, retain) NSString *A_StringToRetain; and NSString *B_StringToRetain;
Maybe someone could explain the difference between property: in .h file @property(nonatomic,retain) NSString *someString;
aclass.h @interface aClass : NSObject { NSString *name; } @property (nonatomic, retain) IBOutlet NSString
What is the difference between @property(nonatomic, retain) that we used in Xcode 3.2 and
What is the difference between (retain, nonatomic) and (nonatomic, retain) in code such as
Assuming that header declaration contains @property(nonatomic, assign) DoublyLinkedList *doublyLinkedList; Is there any difference between
I thought I had understand the difference between retain and copy . But when
What's the difference between @{property} and ${property} in accessing Ant properties? Didn't see any
I like to learn the difference between Class Property and Prototype in Javascript what

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.