Objective C Confusion
On page 45 of Craig Hockenberry’s iPhone App Development: the missing manual
, we’re shown the idiom:
if (exclamationCount != nil) {
[exclamationCount release];
exclamationCount = [nil retain];
}
I'm missing something, obviously. Since [nil retain] does nothing and returns nil, so why not write
exclamationCount=nil; ?