When you implement a method, parameters / local variables use the same namespace as instance variables. However, they do not share the same namespaces as the declared properties, which means that a class can declare a property named someData (or inherit from one of its superclasses), have an instance variable of a subdirectory with some other name, and to implement a method of this class may also have a parameter / local variable named someData - the compiler will not give a warning in this case.
I assume that you have a declared property called tableView , as well as an instance variable called tableView that is either explicitly declared in the interface or automatically created when the property is synthesized. In this case, if you define a method that takes a parameter named tableView or declares a local variable called tableView , this local declaration will hide the instance variable called tableView (but not the property).
In the case of the UITableViewController there is no instance variable named tableView . There is a declared property called tableView , which, since it will not be hidden by a local (variable) declaration in another namespace.
One simple fix to avoid compiler warnings is to specify an instance variable name. For example, an instance variable might be called _tableView , and the property would still be called tableView , but would be synthesized as @synthesize tableView = _tableView .
user557219
source share