Getting object name in Objective-c
问题 suppose i have a class Foo and an instance of this class myFoo: Foo *myFoo; is there any method "dispalyFooObjectName" that can display the name of the object, for exmample : NSLog(@"i was called from %s", [myFoo dispalyFooObjectName]); and the result will be : i was called from myFoo 回答1: In most programming languages objects don't have names. Just because some variable myFoo references your object, doesn't mean that your object is "called" myFoo . And in most C-based languages variable