How do I replace weak references when using ARC and targeting iOS 4.0?

后端 未结 3 1174
有刺的猬
有刺的猬 2020-12-07 08:34

I\'ve begun developing my first iOS app with Xcode 4.2, and was targeting iOS 5.0 with a \"utility application\" template (the one that comes with a FlipsideViewController).

3条回答
  •  生来不讨喜
    2020-12-07 08:59

    If only using weak references for additional safety, manually call the new runtime functions if they're available and fallback to simple assignment on __unsafe_unretained variables if not.

    ZWRCompatibility.h will simplify this somewhat.

提交回复
热议问题