Asking Questions about Classes

As you start working with variables that can contain objects from different classes, you might need to ask questions such as the following:

Image Is this object a rectangle?

Image Does this object support a print method?

Image Is this object a member of the Graphics class or one of its descendants?

You can then use the answers to these questions to execute different sequences of code, avoid an error, or check the integrity of your ...

Get Programming in Objective-C, Sixth Edition 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.