I am working on this tutorial application and the code gives me this warning:
Xcode WARNING: unused object error: unused variable
It gives an error while executing this statement:
int newRowIndex = [self.checklist.items count];
What causes this? What steps should I take to solve this problem?
The variable is newRowIndexinitialized, but not used anywhere.
newRowIndex
This warning means that you have created a variable newRowIndexbut are not using it anywhere.
To disable the warning, use intsomewhere like
int
int newRowIndex = [self.checklist.items count]; NSLog(@"New Row Index: %i", newRowIndex);
, , , .
You can turn off warnings (not recommended, but if you just want to make sure that you can create something) by searching for "Warning Policies" and turning "Turn warnings as errors" to "None".
If you really do not want to receive such warnings, follow these steps: