David Poxon
David Poxon

Reputation: 2503

Type NSError? does not conform to protocol '_RawOptionSetType'

I have the following statement:

func sessionStateChanged(session:FBSession, state:FBSessionState, error:NSError?) {
        // If the session was opened successfully
        if error == nil && state == FBSessionStateOpen {
            println("Session opened");
        }
}

which has the following error on the line of the if-statement:

Type NSError? does not conform to protocol '_RawOptionSetType'

However if I remove the second condition, so the code reads:

if error == nil {
    println("Session opened");
}

There is no error. This leads me to believe tat the NSError? type is not the issue and that it has something to do with the multiple conditions.

Upvotes: 1

Views: 914

Answers (1)

Mundi
Mundi

Reputation: 80265

One way to get clearer error messages might be to start a new if statement inside the first rather than combining with && .

Upvotes: 1

Related Questions