mm24
mm24

Reputation: 9596

Difference between "@property(nonatomic, strong)" and "@property"

What is the difference between these two declarations in Objective-C?

I have been looking at some Apple source code example and they used the second one in various circumstances. I just wanted to understand why and when is best to use the second version rather than the first one (I know the difference between strong, weak, atomic, nonatomic).

@property(nonatomic, strong) NSObject * myObject;

// vs

@property NSObject * myObject2;  //No additional qualifiers 

Upvotes: 1

Views: 383

Answers (1)

Usama
Usama

Reputation: 1965

@property NSObject * myObject2

// is same as
@property (atomic,strong) NSObject * myObject2 

which one to use, is developer's personal choice

Upvotes: 5

Related Questions