Understanding reference counting with Cocoa and Objective-C

后端 未结 14 1721
攒了一身酷
攒了一身酷 2020-11-22 16:46

I\'m just beginning to have a look at Objective-C and Cocoa with a view to playing with the iPhone SDK. I\'m reasonably comfortable with C\'s malloc and f

14条回答
  •  情书的邮戳
    2020-11-22 17:26

    I'll not add to the specific of retain/release other than you might want to think about dropping $50 and getting the Hillegass book, but I would strongly suggest getting into using the Instruments tools very early in the development of your application (even your first one!). To do so, Run->Start with performance tools. I'd start with Leaks which is just one of many of the instruments available but will help to show you when you've forgot to release. It's quit daunting how much information you'll be presented with. But check out this tutorial to get up and going fast:
    COCOA TUTORIAL: FIXING MEMORY LEAKS WITH INSTRUMENTS

    Actually trying to force leaks might be a better way of, in turn, learning how to prevent them! Good luck ;)

提交回复
热议问题