Home
Sign Up
Sign In
V2EX
›
C
How to print out the name of an object in Objective-C?
eato
·
Jul 27, 2014
· 1834 views
This topic created in 4483 days ago, the information mentioned may be changed or developed.
Supplement 1 ·
Jul 27, 2014
anArray contain several objects,
for (theObject *p in anArray) {
NSLog(@"object's name:%@, others...", p.description, ...);
}
How to override description to return the object's name?
Supplement 2 ·
Jul 27, 2014
@
Zhang
是这个意思,谢谢!
Object
Objective
print
6 replies
•
2014-07-27 21:16:38 +08:00
dorentus
Jul 27, 2014
1
1
Define “the name of an object”。
ETiV
Jul 27, 2014 via iPhone
1
2
[[obj class] description]?
Zhang
Jul 27, 2014
1
3
@
dorentus
He probably means the name of the pointer which points to the object.
sumanx
Jul 27, 2014
4
NSStringFromClass([obj class])
nikolai
Jul 27, 2014
5
NSString * NSStringFromClass(Class aClass);
canautumn
Jul 27, 2014
6
http://lmgtfy.com/?q=objective+c+description+override#seen
第一条就是
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
1345 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 127ms ·
UTC 20:24
·
PVG 04:24
·
LAX 12:24
·
JFK 15:24
♥ Do have faith in what you're doing.
❯