Forum Discussion

brizzly's avatar
brizzly
Helpful | Level 5
4 years ago
Solved

SwiftyDropbox.LoadingViewController error : not key value coding-compliant for the key cancelButton

  After authorizing DropBox from iOS code in Swift I get this error :

 

*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<SwiftyDropbox.LoadingViewController 0x10a91c250> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key cancelButton.'

 

AppDelegate

let oauthCompletion: DropboxOAuthCompletion = {

  if let authResult = $0 {

  switch authResult {

  case .success:

  print("Success! User is logged into DropboxClientsManager.")

  case .cancel:

  print("Authorization flow was manually canceled by user!")

  case .error(_, let description):

  print("Error: \(String(describing: description))")

  }

  }

}

canHandleUrl = DropboxClientsManager.handleRedirectURL(url, completion: oauthCompletion)

return canHandleUrl

 

 

DropBox auth button:

 

DropboxClientsManager.authorizeFromControllerV2(UIApplication.shared,

controller: self,

loadingStatusDelegate: nil,

openURL: { (url: URL) -> Void in UIApplication.shared.open( url, options: [:], completionHandler: nil)},

scopeRequest: nil)

 

  • I found it.

     

    I used a xib file named LoadViewController.xib , and DB's SDK is using the same class name. I did renamed my xib and now its alright:)

     

    Thank you very much

    Julien

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    The SwiftyDropbox SDK doesn't contain a reference to something called "cancelButton". Is that something from your project? Did you make any modifications to the SDK?

     

    In any case, I can't reproduce the issue you're seeing with the code you supplied. Also, "canHandleUrl" isn't defined; I had to add a "let". Is there additional relevant code?

     

    If you're still running in to this, please share the full steps and code necessary to reproduce this issue, as well as the version numbers of SwiftyDropbox, Xcode, and iOS where you're seeing this, so we can look into it. Thanks!

    • brizzly's avatar
      brizzly
      Helpful | Level 5

      I found it.

       

      I used a xib file named LoadViewController.xib , and DB's SDK is using the same class name. I did renamed my xib and now its alright:)

       

      Thank you very much

      Julien

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,941 PostsLatest Activity: 2 days ago
351 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!