iPhone vs Android
Jacob Carlborg via Digitalmars-d
digitalmars-d at puremagic.com
Wed Sep 14 02:44:10 PDT 2016
On 2016-09-13 20:40, Steven Schveighoffer wrote:
> Swift doesn't support exceptions AFAIK. It supports weird error handling
> that looks similar to exceptions, but is really just a standard return.
>
> i.e. this:
>
> do
> {
> try someFunctionThatErrors(arg)
> }
> catch(Exception ex)
> {
> // handle ex
> }
>
> really compiles like this:
>
> var _err : Error?
> someFunctionThatErrors(arg, &_err)
> if(_err != nil)
> {
> let ex = _err!.exception
> }
Exactly and you're not supposed to catch exceptions in Objective-C. It's
more like Errors in D.
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list