2

I would like to integrate OneDrive API to my app but I get this error when I try to initialize LiveConnectClient:

Extra argument 'scopes' in call

Here is my code:

self.liveClient = LiveConnectClient(clientId: ClientID, scopes: Scopes, delegate: self, userState: "initialize")

When I try the version without scope, then I get the same error only with userState argument. I don't have any error when I try version with clientId and delegate.

Here my variables:

private let ClientID = "000000001234567"
private let Scopes = ["wl.signin", "wl.skydrive", "wl.skydrive_update", "wl.offline_access"]
private var liveClient: LiveConnectClient

What is wrong?

Bartosz Bialecki
  • 4,391
  • 10
  • 42
  • 64

1 Answers1

1

Certain Swift errors are surprisingly unhelpful at the early stage in the development of the language. My guess would be that one of the arguments in that method call is of the wrong type, and the compiler is just getting a bit confused about what the problem actually is.

  • Is ClientID a String? I presume it begins with an uppercase character because it is a constant, not because it is itself a type.
  • Same as above for Scopes.
  • Does self definitely conform to LiveAuthDelegate?
Stuart
  • 36,683
  • 19
  • 101
  • 139
  • I updated my question. ClientID is a string, Scopes is an array of strings, my class conforms to LiveAuthDelegate. – Bartosz Bialecki Mar 24 '15 at 10:06
  • You were right. I added LiveAuthDelegate to my class definition, but I did not implement the methods yet, when I implement protocol method, everything works but this error is really not helpful. Thanks. – Bartosz Bialecki Mar 24 '15 at 10:08