The cast is unnecessary, although it's usually best to keep an object as an id
until you know it isn't an NSNull
(e.g. if you just pulled it out of a collection). If you have an NSString*
which might actually be NSNull
it can be confusing. Perhaps the original author wanted to make it clear that the string actually could be something else?
Also, NSNull
is documented as a singleton, so you could (if you wanted) compare using ==
.