mylogon
mylogon

Reputation: 2979

Dropbox not calling delegate methods on iPad only

I'm using dropbox to upload files to a user's Dropbox.
On iPhone it works flawlessly, but on iPad the delegate methods for the DBRestClientDelegate are not being called.
I am still using v1.
The code I'm using is

- (DBRestClient *)restClient {
    if (!_restClient) {
        _restClient =
        [[DBRestClient alloc] initWithSession:[DBSession sharedSession]];
        _restClient.delegate = self;
    }
    return _restClient;
}

[[self restClient] uploadFile:[NSString stringWithFormat:@"%@.jpeg",fileName]
                           toPath:@"/"
                    withParentRev:nil
                         fromPath:imagePath];

After calling this on the iPhone the delegate method

- (void)restClient:(DBRestClient*)client uploadedFile:(NSString*)destPath from:(NSString*)srcPath 

is successfully called, allowing me to handle that. On the iPad, however, that, along with the other delegate methods, are not called, does not upload the file and does not throw any errors.

Any thoughts are appreciated.
Thanks,
Luke

Upvotes: 0

Views: 40

Answers (1)

Greg
Greg

Reputation: 16940

There are a few things that might cause your delegate methods to not be called:

  1. Your rest client is nil or is being released (e.g., by ARC) prematurely.
  2. You're making the call in a background thread that doesn't have a run loop.
  3. Your delegate method that should be called back has a typo in it. Unfortunately the SDK doesn't warn you if it can't find a delegate method to call; it just completes without telling anyone.

Upvotes: 1

Related Questions