Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode WARNING: Unused Entity Issue: Unused Variable

I'm working on this tutorial application and the code is giving me this warning:

Xcode WARNING: Unused Entity Issue: Unused Variable

It's giving the error when executing this statement:

int newRowIndex = [self.checklist.items count];

What's causing it? Which steps should I take to resolve this?

like image 234
specht057 Avatar asked May 07 '12 05:05

specht057


3 Answers

The variable newRowIndex is initialized but not being used anywhere else.

like image 116
Allamaprabhu Avatar answered Nov 14 '22 12:11

Allamaprabhu


This warning just means that you created a variable, newRowIndex, but are not using it anywhere.

To silence the warning, use this int somewhere, like

int newRowIndex = [self.checklist.items count];
NSLog(@"New Row Index: %i", newRowIndex);
like image 27
WrightsCS Avatar answered Nov 14 '22 12:11

WrightsCS


It's probably because your build settings might have warnings flagged as errors.

You can silence warnings (not advised but if you just want to make sure you can build something) by searching for "Warning Policies" and turning "Treat Warnings as Errors" to "No".

like image 2
silk Avatar answered Nov 14 '22 12:11

silk