• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Error unwrapping an optional which isn't an optional
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error unwrapping an optional which isn't an optional


  • Subject: Re: Error unwrapping an optional which isn't an optional
  • From: Charles Srstka <email@hidden>
  • Date: Mon, 21 Sep 2015 20:58:35 -0500

> On Sep 21, 2015, at 6:03 PM, Greg Parker <email@hidden> wrote:
>
> selectedRow's "row index or -1" behavior is an obvious candidate for a Swift optional, but we don't currently have a good way to bridge such API with Objective-C.

How about allowing the “nullable” keyword on non-pointer types, but adding a parameter that specifies the nil condition? An API like selectedRow could simply have nullable(-1) added to its type, and then Swift could interpret the value as nil if it encountered a -1 from that API.

Charles

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >Error unwrapping an optional which isn't an optional (From: Alex Hall <email@hidden>)
 >Re: Error unwrapping an optional which isn't an optional (From: Greg Parker <email@hidden>)

  • Prev by Date: Re: Error unwrapping an optional which isn't an optional
  • Next by Date: Re: Error unwrapping an optional which isn't an optional
  • Previous by thread: Re: Error unwrapping an optional which isn't an optional
  • Next by thread: Re: Error unwrapping an optional which isn't an optional
  • Index(es):
    • Date
    • Thread