0

I am new to objective-c. Trying to learn Storyboard. I am getting following error in ViewController.h:

'retain (or strong)' attribute on property 'collectionView' does not match the property inherited from 'UICollectionViewController'

Here is the code where it is complaining:

#import <UIKit/UIKit.h>

    @interface ViewController : UICollectionViewController <UICollectionViewDataSource, UICollectionViewDelegate>

    @property (nonatomic, weak) IBOutlet UICollectionView *collectionView;

    @end

thanks.

tomtom
  • 1
  • 1
  • 2
    The UICollectionViewController already declares that property. Since you're inheriting from it, you need not repeat the declaration. – danh Jan 16 '15 at 20:27

1 Answers1

3

Your collectionView property is overriding a property inherited from UICollectionViewController, and weak doesn't match the inherited memory management semantic. Given that the property already exists, you can simply use it -- there's no need to redefine it.

jlehr
  • 15,557
  • 5
  • 43
  • 45