It seems to be
if(myObj == (typeOfMyObj *) kCFNull){
//myObj is null
}
and
if(myObj == (typeOfMyObj *) [NSNull null]){
//myObj is null
}
produce the same result.
Is this always the case? I’m developing an iOS 5 application.
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It appears none of Apple’s docs state that
NSNullandCFNullRefare toll-free-bridged, but it nevertheless seems that they are and have been sinceCFNullRefwas introduced in Mac OS X 10.2.NSNullwas available starting with Mac OS X 10.0. In the end, they are both really just sentinel values that serve as a distinguished NULL object.There’s probably a way for your code to avoid depending on
kCFNull == [NSNull null], but if you can’t for some reason, then I wouldn’t worry about it too much.