Exceptions and the Console Window
In a language like C, we have functions, and when we call a function, code is executed. If we try and call a function that doesn’t exist, the compiler says, “I can’t do that, Joe,” and the code will fail to compile. This is known as a compile-time error.
Objective-C, being a dynamically typed language, isn’t able to figure out at compile time whether an object will respond to a message. (An object only responds to a message if its class implements the associated method.) The compiler will warn you if it thinks you are sending a message to an object that won’t respond, but the code will still compile. If, for some reason (and there are many), you end up sending a message to an object that doesn’t respond, your ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access