Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 558
DevC Avatar asked Apr 15 '15 16:04

DevC


4 Answers

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

like image 187
Mark McCorkle Avatar answered Jan 01 '23 07:01

Mark McCorkle


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.

like image 39
fozoglu Avatar answered Jan 01 '23 08:01

fozoglu


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.

like image 27
gnasher729 Avatar answered Jan 01 '23 07:01

gnasher729


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.

like image 22
NSCoder Avatar answered Jan 01 '23 09:01

NSCoder