Strong or weak declaration of the UIImageView and UIImage properties built into the UIScrollView?

I have a UIScrollview built into NavController, both pulled into iOS6 storyboard. In my scrollViewController viewDidLoad, I programmatically add a UIImageView and save a property for the image that goes into that UIImageView.

@interface MyScrollViewController () <UIScrollViewDelegate> @property (weak, nonatomic) IBOutlet UIScrollView *scrollView; @property (strong, nonatomic) UIImageView *imageView; @property (strong, nonatomic) UIImage *image; @end 

Dragging and dropping a ScrollView into a storyboard and plugging it into an outlet made this a weak default property, but what is the best practice for the other two properties?

+4
source share
1 answer

Recent versions of Xcode use strong by default. If you use weak , you may encounter compiler warnings about accessing a weak variable several times in a given area. So just use strong for everyone if you have no reason not to.

+3
source

All Articles