How can I get rid of an “unused variable” warning in Xcode?

I’m unsure if it’s still supported in the new LLVM compiler, but GCC has an “unused” attribute you can use to suppress that warning:

BOOL saved __attribute__((unused)) = [moc save:&error];

Alternatively (in case LLVM doesn’t support the above), you could split the variable declaration into a separate line, guaranteeing that the variable would be “used” whether the macro expands or not:

BOOL saved = NO;
saved = [moc save:&error];

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)