@property definitions with ARC: strong or retain?

前端 未结 4 831
失恋的感觉
失恋的感觉 2020-11-27 14:38

Using Xcode 4.2 and ARC, I notice that the auto-generated code for an NSManagedObject still reads like this for properties:

@property (nonatomic         


        
4条回答
  •  半阙折子戏
    2020-11-27 14:56

    1) Shouldn't retain now be replace with strong or weak?

    No. You cannot replace retain with weak; they are different. And strong is a 100% synonym for retain; they are identical. You can use either, so there is no "should" here. You can replace retain with strong if you like, but you don't have to.

    2) Why does the auto-generated code still use retain

    Why not? See (1). retain is correct so there is no problem.

    3) What is the correct replacement for retain in this property statement?

    There is no need to replace retain.

    I'm currently debugging a problem using NSFetchRequest, and I thought this might be the source of the problem. Thoughts?

    It isn't.

提交回复
热议问题