Auto property synthesize will not synthesize property - new warning iOS8.3

11k Views Asked by At

After updating to iOS8.3 I started getting a bunch of new warnings that werent there on iOS8.2. One in particular that caught my eye;

@property (strong, nonatomic) IBOutlet UITableView *tableView;

which was declared in a '.m' file.

What has changed in iOS8.3 to make this a warning?

Auto property synthesis will not synthesize property 'tableView'; it will be implemented by its superclass, use @dynamic to acknowledge intention
4

There are 4 best solutions below

0
Mark McCorkle On BEST ANSWER

If you're using a UITableViewController then tableView is already synthesized. (ie. self.tableView is the tableView of the UITableViewController).

1
gnasher729 On

What has changed? The compiler has become more clever.

You are probably subclassing UITableViewController.

UITableViewController already has a property named tableView. It is already synthesized or implemented otherwise in UITableViewController. So the warning tells you that you are not getting your own tableView property, but that you are getting the one supplied by UITableViewController.

Obviously if you were not aware of the tableView in UITableViewController, and if you wrongly assumed that this is your property, under your control, there would be trouble. That's why you get a warning. So if that is what you were doing, then your code was always badly broken, and needs fixing.

But if you just have the @property declaration in your code, but you know that it is actually the UITableViewController property, no harm is done, but remove the @property because it is wrong.

1
fozoglu On

I faced similar issue too. I solved this by the following method. Inside your .m file write @dynamic tableView under the @implementation

I hope your issue will be solved.

0
NSCoder On

Had a similar problem with a custom UITableViewCell creating a new property called imageView. Since a property named imageView already existed, I kept getting the error message. I simply changed the name to projectImageView and it worked.