Thursday, August 26, 2010

How to Remove Unused Parameter Warning

No Warnings Policy requires sometimes forcing a compiler warning to be ignored. One such case is when you are given a function you absolutely must use, but don't need the parameters:
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
#pragma unused(application)
    [window addSubview:viewController.view];
    [window makeKeyAndVisible];
}
There are several ways to ignore warnings, I found #pragma to be a clean solution.

No comments:

Post a Comment