user141302
user141302

Reputation:

strong property in Xcode without ARC?

When I run Xcode 4.5 , By default it is with ARC Off stage.But When we create Xcode project Strong property comes instead of Retain.

1)If Strong and weak related to ARC , why is it coming in non-Arc project?

2)If Both strong and retain are same, If I change the keyword retain to strong in earlier xcode versons for non-Arc projects,will it work correctly?

Upvotes: 2

Views: 822

Answers (2)

SantiagoRodriguez
SantiagoRodriguez

Reputation: 308

In addition to H2CO3 answer´s: xCode will not warn you about this situation. Indeed, if you are adding this class from ARC implemented project , remember to implement -(void)dealloc() method and release delegates in case of protocol implementation.

Upvotes: 0

user529758
user529758

Reputation:

Yes, strong is just a synonym for retain when not using ARC - it's included in non-ARC projects by default to minimize the changes needed when converting between ARC and non-ARC, since retain doesn't work with ARC but strong works with both project types.

Also, yes, if you change it to retain, that won't break your code.

Upvotes: 4

Related Questions