0

My code looks like this:

-(void)setGuiDisplayMode:(id)mode 
{
// constrain inputs
if ( [mode intValue] < 3 && [mode intValue] > -1 ) {
    guiDisplayMode=[mode intValue];
} else {
    guiDisplayMode=0;
}
NSString *titles[3]={
    @"Narg",
    @"Fubar",
    @"Eep"};
[mView[0] setValue:titles[guiDisplayMode] forKey:@"inputTitle"];

}

When I build this in Xcode 4.6.3 using the Apple LLVM compiler 4.2, I get an "Unused Entity Issue" "Unused variable 'titles'" warning which is clearly incorrect. When I look at the compiler output, there is no warning there, so apparently the warning is coming from the post-compilation "indexing" that Xcode does.

Since this warning isn't coming from the compiler, is there anything I can do about it? Is this a known Xcode bug?

Thanks, Chris

Betty Crokker
  • 3,001
  • 6
  • 34
  • 68
  • Provided there is in scope (a) an `int` variable `guiDisplayMode` and (b) an `NSArray *` variable `mView`, this code compiles without warnings. Try a clean build and if it persists look at the surrounding code. – CRD Jul 17 '13 at 17:10
  • Actually, from the looks of the other code, I would bet on mView being an UIView*[]. I am surprised that ARC isn't complaining about regular C arrays of objects. When I get this sort of problem, I look at the actual compiler output which is available in one of the tabs in XCode - you occasionally see it complaining about something quite different from what you expect. Alternately, you haven't told us the whole story and there is another error that has caused it to completely ignore the setValue:forKey: line during compilation, then not seen it during post-analysis – Jeff Laing Jul 17 '13 at 23:19

0 Answers0