O'Reilly logo

Protocol-Oriented Programming with Swift by Jon Hoffman

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

Chapter 3. Catching Our Errors

When I first started writing iOS and OS X applications with Objective-C, one of the most noticeable deficiencies was the lack of exception handling when working with the Cocoa and Cocoa Touch frameworks. Most modern programming languages (such as Java and C#) use try-catch blocks or something similar to handle exceptions. While Objective-C did have the try-catch block, it wasn't used within the Cocoa framework itself and it never felt like a true part of the language. I do have significant experience with C, so I was able to understand how the Cocoa and Cocoa Touch frameworks received and responded to errors; to be honest, I actually preferred this method however I had grown accustomed to exception handling with ...

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