Safe casting in Objective C -
What's the purpose-something like C ++ safe briefs?
I know that those objectives are in C ++, but I am not sure about possible side effects. The objective C ++ can slow down collection time - is there any other reason to use it?
Objective-c ++ is inserted securely, alternatively, we can use runtime reflections :
id myOb = [someObject getObject]; NSAssert ([myOb isKindOfClass: [MyClass class]], @ @ MyClass is not like the return value type. "); MyClass * newOb = (MyClass *) myOb;
Reference:
:
Comments
Post a Comment