代码之家  ›  专栏  ›  技术社区  ›  Kenny Winker

检查iOS上运行时块的可用性

  •  8
  • Kenny Winker  · 技术社区  · 14 年前

    我需要在运行时测试块的可用性,以便处理与IOS3的向后兼容性。有什么建议吗?

    编辑: 到目前为止我正在做 if (!NSClassFromString(@"NSBlockOperation")) {...} 似乎在工作…

    1 回复  |  直到 13 年前
        1
  •  7
  •   Community CDub    8 年前

    您还需要确保弱链接 libSystem.B.dylib ,将基本SDK设置为4.0,将部署目标设置为3.1.3,如前所述。 here

    关于如何处理iOS版本控制问题的良好概述,也可以在本Cocoa with Love文章中找到: Tips & Tricks for conditional iOS3, iOS3.2 and iOS4 code