When porting Java code to ObjC, how best to represent checked exceptions?

后端 未结 6 827
梦如初夏
梦如初夏 2021-02-09 01:08

I am working on porting a Java codebase to Cocoa/Objective-C for use on desktop Mac OS X. The Java code has lots and lots of methods with checked exceptions li

6条回答
  •  别跟我提以往
    2021-02-09 01:43

    Exceptions are probably the best approach, as the 64-bit Obj-C ABI (runtime) uses zero cost exceptions, so you get cleaner code at no real cost. Of course in 32-bit the old setjmp/longjmp exceptions are still in use and they don't interact with C++ so if that's a goal then you have a problem.

提交回复
热议问题