I used NSLog(@”%@”,super) in a method(any method) and it is crashing…. Why? How to print the super contents?
Updated :
currentclassname : superClassName
{
}
and also if i use NSLog(@”%@”, [super description]); It is printing "<currentclassname: 0x3db7230>" instead of superClassName… It is expected to print superClassName right.
Thanks in advance,
When encountering the keyword
superand a method call on it, the compiler generates a different call –objc_msgSendSuper*()instead of the usualobjc_msgSend*().objc_msgSendSuper*()calls get an argument of typeobjc_super*instead ofobjc_object*:So,
objc_super*values aren’t special instances, they have to be used with the specialobjc_msgSendSuper*()functions.Thus, as Alex says, just call
-descriptiondirectly onsuper– its value is meaningless outside of the context its in unless you specifically use it with a runtime function likeobjc_msgSendSuper().