Santosh Singh
Santosh Singh

Reputation: 887

Why Xcode 9 creates my outlet (strong, nonatomic) by default

When I control-drag outlet from the storyboard, I got the strong property by default. I'm using Xcode 9.4.1. The following code is what it looks like. Is it because of XCode Swift compatibility as in Swift it makes sense to create strong.

@property (strong, nonatomic) IBOutlet UILabel *lbl

Upvotes: 2

Views: 162

Answers (1)

Arkhan
Arkhan

Reputation: 56

The default value should be weak, but if you once change it manually to strong as shown in the photo, the default value changes to strong, so you need to manually put it back to weak.

image

Upvotes: 3

Related Questions