SDImageCache.m报错Unused variable 'fileName'

GCC手册中的相关解释:

unused:This attribute, attached to a function, means that the function is meant to be

        possibly unused. GCC will not produce a warning for this function.

===============================================================================

used: This attribute, attached to a function, means that code must be emitted for the

       function even if it appears that the function is not referenced. This is useful,

       for example, when the function is referenced only in inline assembly.

表示该函数或变量可能未被使用,这个属性可以避免编译器产生警告信息。

把for (NSString *fileName in fileEnumerator)

修改为for (__attribute__((unused)) NSString *fileName in fileEnumerator)即可。

猜你喜欢

转载自eric-gao.iteye.com/blog/2230081