Chapter 10. Introspection

Introspection (reflection) is the act of exploring information about an object, often referred to as its metadata: the class of the object, the methods it implements, what properties it declares, the protocols (interfaces) it conforms to, and so on. The common questions ("What class is this object?," "Can I treat this object as a specific class?," and "Does this object implement a specific method?") are all easy to answer. This chapter will first tell you how to answer those common questions. It will then look into the deeper exploration of objects and classes.

This chapter will also explore Key-Value Coding, a technology closely related to introspection. Key-Value Coding, or KVC, allows you to access the properties of ...

Get Learn Objective-C for Java Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.