2010-01-14 51 views

回答

4

由于的CoreFoundation是基于“不透明”的引用,这是难以检查不明物体。没有像普通的objective-c类那样的isa-pointer,你可以查看它以便了解任意对象的类型。然而,CF有一些功能提供,可以帮助你:具体而言,CFGetTypeID():

CFTypeID type = CFGetTypeID(anObject); 
if (CFArrayGetTypeID() == type) 
    printf("anObject is an array."); 
else 
    printf("anObject is NOT an array."); 

CFType Reference

+0

工作。谢谢 :-) – VLegakis 2010-01-15 16:02:45