While developing my code for using the new Objective-C SDK, I am running on the Xcode emulator. The first time I tried OAuth, it worked and brought up the Dropbox login web page. NSLog verified that the OAuth result was success. The second time I ran it there was an exception thrown saying "A Dropbox client is already authorized". How can I properly ensure there is no authorized client before I start to create a new one, or otherwise avoid this exception? The call stack is:
2016-09-12 14:39:54.755 TuneLab[1303:57987] *** Assertion failure in +[DropboxClientsManager authorizeFromController:controller:openURL:browserAuth:], /Users/robertscott/Documents/iOS Proj/TuneLab/Pods/ObjectiveDropboxOfficial/Source/ObjectiveDropboxOfficial/PlatformDependent/iOS/DropboxClientsManager+MobileAuth.m:32
2016-09-12 14:39:54.760 TuneLab[1303:57987] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'A Dropbox client is already authorized'
*** First throw call stack:
(
0 CoreFoundation 0x04017494 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x03ad1e02 objc_exception_throw + 50
2 CoreFoundation 0x0401732a +[NSException raise:format:arguments:] + 138
3 Foundation 0x00599322 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 118
4 TuneLab 0x001bb1d1 +[DropboxClientsManager(MobileAuth) authorizeFromController:controller:openURL:browserAuth:] + 881
5 TuneLab 0x0003ef99 -[DBxfer buttonPressed:] + 290
6 libobjc.A.dylib 0x03ae60b5 -[NSObject performSelector:withObject:withObject:] + 84
7 UIKit 0x00944e38 -[UIApplication sendAction:to:from:forEvent:] + 118
8 UIKit 0x00944db7 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 64
9 UIKit 0x00ae8f3b -[UIControl sendAction:to:forEvent:] + 79
10 UIKit 0x00ae92d4 -[UIControl _sendActionsForEvents:withEvent:] + 433
11 UIKit 0x00ae82c1 -[UIControl touchesEnded:withEvent:] + 714
12 UIKit 0x009c552e -[UIWindow _sendTouchesForEvent:] + 1095
13 UIKit 0x009c65cc -[UIWindow sendEvent:] + 1159
14 UIKit 0x00967be8 -[UIApplication sendEvent:] + 266
15 UIKit 0x0093c769 _UIApplicationHandleEventQueue + 7795
16 CoreFoundation 0x03f29e5f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
17 CoreFoundation 0x03f1faeb __CFRunLoopDoSources0 + 523
18 CoreFoundation 0x03f1ef08 __CFRunLoopRun + 1032
19 CoreFoundation 0x03f1e846 CFRunLoopRunSpecific + 470
20 CoreFoundation 0x03f1e65b CFRunLoopRunInMode + 123
21 GraphicsServices 0x05c15664 GSEventRunModal + 192
22 GraphicsServices 0x05c154a1 GSEventRun + 104
23 UIKit 0x00942eb9 UIApplicationMain + 160
24 TuneLab 0x000085c6 main + 230
25 libdyld.dylib 0x04bb2a25 start + 1
26 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)