开发者

XCode - trace datatype - typeof?

i´ve sea开发者_JS百科rched the xcode doku but didn´t found anything about logging the datatype of a variable. How can i trace the typeof ?

Thanks


Duplicate of: In Objective-C, what is the equivalent of Java's "instanceof" keyword?

Summary:

Try [myObject class] for returning the class of an object.

You can make exact comparisons with:

if ([myObject class] == [MyClass class])

but not by using directly MyClass identifier.

Similarily, you can find if the object is of a subclass of your class with:

if ([myObject isKindOfClass:[AnObject class]])

as suggested by Jon Skeet and zoul.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜