1. You own any object you create by allocating memory for it or copying it.Related methods:alloc,allocWithZone: mutableCopy,mutableCopyWithZone:
译: 你拥有任意一个你创建的对象为他分配内存或复制它。相关的方法:alloc,allocWithZone:mutableCopy mutableCopyWithZone:
2. If you are not the creator of an object, but want toensure it stays in memory for you to use, you can express anownership interest in it.Related method:retain
译: 如果你不是一个对象的创造者,但要确保它保持在内存中供您使用,你可以声明对它的所有权(使它的引用计数+1)。相关的方法:retain
3. If youown an object, either by creating it or expressing an ownership interest, you are responsible forreleasing it when you no longer need it. Related methods:release,autorelease
译:如果你拥有一个对象,无论通过创建还是声明(通过上面⬆️)获得的所有权,当你不再需要它,你负责释放它。相关的方法:release,autorelease
4. Conversely, if you are not the creator of an object and have not expressed an ownership interest, you must not release it.
译: 相反,如果你没有对象的创建者和没有声明对它的所有权,你不能释放它。