I am new at programming in general (though I have had a C class many, many years ago) and am learning Objective-C for programming on the iPhone. I have what I think is a simple question, but after looking for a while (days, off and on) I can't find the answer that I'm looking for explicitly.
I know that when subclassing an Objective-C class I should implement the initialize method along with the deallocate method (unless using ARC for the latter, if I am correct?). The questions are:
Thanks for your help!
init
and dealloc
if the inherited versions are sufficient. Also, ARC does not free you from having to write dealloc
in all cases (but it certainly covers the overwhelming majority). For example, if you allocate memory for your object using malloc
, you need to free it in the dealloc
.@requried
. These methods are marked in the protocol reference. For example, tableView:cellForRowAtIndexPath:
and tableView:numberOfRowsInSection:
are marked with the "required method" tag in Apple's documentation.