O'Reilly logo

Programming in Objective-C, Sixth Edition by Stephen G. Kochan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required