Skip to content

Objective-C supports exception handling with @try/@catch, but the community settled on NSError pointers instead. Here's why.

License

Notifications You must be signed in to change notification settings

BleepingSwift/try-catch-nserror-objc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TryCatchNserrorObjc

Sample Objective-C code demonstrating Objective-C supports exception handling with @try/@catch, but the community settled on NSError pointers instead. Here's why..

This project accompanies the article: Why Objective-C Has try-catch But Nobody Uses It

Requirements

  • Xcode 26.2+
  • iOS 26.0+

Getting Started

  1. Clone this repository
  2. Run xcodegen generate (requires XcodeGen)
  3. Open TryCatchNserrorObjc.xcodeproj
  4. Build and run

What's Included

  • main.m: Source file
  • AppDelegate.h: Source file
  • AppDelegate.m: Source file
  • FileProcessor.h: Source file
  • FileProcessor.m: Source file
  • InputValidator.h: Source file
  • InputValidator.m: Source file
  • DemoResult.h: Source file
  • DemoResult.m: Source file
  • ViewController.h: Source file
  • ViewController.m: Source file

Language

This project is written in Objective-C to demonstrate traditional iOS development patterns.

Learn More

Read the full article at BleepingSwift for detailed explanations and additional examples.

License

MIT License - see LICENSE for details.

About

Objective-C supports exception handling with @try/@catch, but the community settled on NSError pointers instead. Here's why.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors