我没有收到有关XCode中stretchableImageWithLeftCapWidth:topCapHeight:方法的弃用警告。
我有部署目标iOS 6.0。
对于其他功能,我将收到其他弃用警告,但对于此功能,则不会收到任何警告。

在构建设置中启用警告。Build Settings-> Warning-> Deprecated Functions为YES
在“构建阶段”设置中,“编译源”没有为任何文件启用任何编译器标志。

最佳答案

这是在UIImage.h中声明的方式:

- (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight;


不推荐使用的方法名称通常如下所示:

- (CGSize)sizeWithFont:(UIFont *)font NS_DEPRECATED_IOS(2_0, 7_0, "Use -sizeWithAttributes:");


为了显示警告,必须存在NS_DEPRECATED中的NSObjCRuntime.h宏之一(或AvailabilityMacros.h中的可用性宏之一)。

这可能被视为错误,应在http://bugreport.apple.com上报告。

10-07 18:55
查看更多