Skip to content

Commit

Permalink
Add initializers that return nil
Browse files Browse the repository at this point in the history
  • Loading branch information
Karol S. Mazur committed Aug 29, 2014
1 parent 7115ff8 commit db730ce
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ To contribute: fork this project, add a section below (don't forget to update th
* [C union support](#c-union-support)
* [Enumerating enum types](#enumerating-enum-types)
* [Flow-sensitive optional unwrapping](#flow-sensitive-optional-unwrapping)
* [Initializers that return nil](#initializers-that-return-nil)
* [Optionals in imported Objective-C frameworks](#optionals-in-imported-objective-c-frameworks)
* [Reflection](#reflection)
* [Static libraries](#static-libraries)
Expand Down Expand Up @@ -145,6 +146,16 @@ if exists x {
Source: https://devforums.apple.com/message/1005148#1005148

### Initializers that return nil

Cocoa initializers do not return optionals, but they may return nil. If an initializer returns nil into a non-optional variable or constant you will crash when trying to access it.

> Yep, this is a known problem and mentioned in the Xcode release notes. You can expect progress here in a subsequent beta.
>
> — Chris Lattner
Source: https://devforums.apple.com/message/1028107#1028107

### Optionals in imported Objective-C frameworks

As of Beta 6, few classes have been audited for optional conformance. More are
Expand Down

0 comments on commit db730ce

Please sign in to comment.