Objective-C memory management, xml parser and other non-trivial examples

前端 未结 6 1590
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-04 18:00

I know the basic principles about memory management (retain count, autorelease pools etc) in Cocoa, but once you go past simple retain/release, it\'s getting a bit more confusin

6条回答
  •  执笔经年
    2021-02-04 18:27

    @1st question

    You only get a reference to the object in the objectArray. It is still in the objectArray which also has the object retained and releasing it is not good here because you didn't do anything that retained it.

    See here for some rules

提交回复
热议问题