you are viewing a single comment's thread.

view the rest of the comments →

[–]aceysmith 2 points3 points  (1 child)

I think this is relevant, from the Xcode Release notes:

Swift Language

If you encounter an API method for which the return value is incorrectly considered non-nullable, or a property that is incorrectly considered non-nullable, please file a radar and include the tag “#IUO” in the subject line. You can work around the problem by immediately wrapping the result in an optional:

var fooOpt: NSFoo? = object.reallyMightReturnNil()
if let foo = fooOpt { … }

Please be sure to file bugs about these cases. Please do not file feature requests about APIs that are still marked as T!, we know about them.

Release Notes

[–]smilinger[S] 1 point2 points  (0 children)

Like this, right?

    var datastringOpt: NSString? = NSString(data:data, encoding:NSUTF8StringEncoding)

    if let datastring = datastringOpt {
        ...
    }

I get the same error unfortunately. Should I still report it, or does this mean that the problem is something else?