As I've written in previous tips – #7 and #12 – pragmas are useful for helping organize code and suppress certain compiler warnings. A warning you sometimes want to suppress is the “Unused Variable” warning. Sometimes you write code where you want to store the result in a local variable, but may not actually use the variable right now (perhaps it is only used in debugging code?).
BOOL result = [[NSFileManager defaultManager] createFileAtPath:aPathString contents:UIImageJPEGRepresentation(anImage, 0.7) attributes:nil];
#pragma unused(result)
The single line of code will trigger a Unused Variable warning with Xcode. By adding the #pragma after the line where the variable is declared, you will suppress the warning, including that you knowingly created the unused variable.
Your feedback is valuable: Do you want more nuggets like this? Yes or No
.