nst / STTwitter

A stable, mature and comprehensive Objective-C library for Twitter REST API 1.1
BSD 3-Clause "New" or "Revised" License
999 stars 161 forks source link

'Not on main thread' Exception since commit c07f989d1a #215

Closed tanmays closed 9 years ago

tanmays commented 9 years ago

Hello,

Since the recent commit c07f989d1a, I've been getting uncaught exception not on main thread issues.

Trying this out in the sample OS X app too exhibits this behaviour.

Here's the log:


2015-09-04 02:22:42.966 STTwitterDemoOSX[7374:21485962] *** Assertion failure in -[STTwitterOSRequest URLSession:dataTask:didReceiveResponse:completionHandler:], /Users/tanmay/Dropbox/Work/TwitterUserInfoGetter/STTwitter-c07f989d1a8b46b56159725d8953e6ff1a7aa2af/STTwitter/STTwitterOSRequest.m:152
2015-09-04 02:22:42.967 STTwitterDemoOSX[7374:21485962] An uncaught exception was raised
2015-09-04 02:22:42.967 STTwitterDemoOSX[7374:21485962] not on main thread
2015-09-04 02:22:42.968 STTwitterDemoOSX[7374:21485962] (
    0   CoreFoundation                      0x00007fff8f0d903c __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x00007fff8b7fc76e objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff8f0d8e1a +[NSException raise:format:arguments:] + 106
    3   Foundation                          0x00007fff9109599b -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
    4   STTwitterDemoOSX                    0x0000000100005d7e -[STTwitterOSRequest URLSession:dataTask:didReceiveResponse:completionHandler:] + 462
    5   Foundation                          0x00007fff910278b8 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
    6   Foundation                          0x00007fff91027685 -[NSBlockOperation main] + 97
    7   Foundation                          0x00007fff91026b3c -[__NSOperationInternal _start:] + 653
    8   Foundation                          0x00007fff91026613 __NSOQSchedule_f + 184
    9   libdispatch.dylib                   0x0000000100173d43 _dispatch_client_callout + 8
    10  libdispatch.dylib                   0x0000000100177fb3 _dispatch_queue_drain + 1804
    11  libdispatch.dylib                   0x0000000100179fc0 _dispatch_queue_invoke + 223
    12  libdispatch.dylib                   0x0000000100176f5e _dispatch_root_queue_drain + 666
    13  libdispatch.dylib                   0x0000000100188cd0 _dispatch_worker_thread3 + 106
    14  libsystem_pthread.dylib             0x00007fff935d4a9d _pthread_wqthread + 729
    15  libsystem_pthread.dylib             0x00007fff935d23dd start_wqthread + 13
)
2015-09-04 02:22:42.980 STTwitterDemoOSX[7374:21485962] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'not on main thread'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff8f0d903c __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x00007fff8b7fc76e objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff8f0d8e1a +[NSException raise:format:arguments:] + 106
    3   Foundation                          0x00007fff9109599b -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
    4   STTwitterDemoOSX                    0x0000000100005d7e -[STTwitterOSRequest URLSession:dataTask:didReceiveResponse:completionHandler:] + 462
    5   Foundation                          0x00007fff910278b8 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
    6   Foundation                          0x00007fff91027685 -[NSBlockOperation main] + 97
    7   Foundation                          0x00007fff91026b3c -[__NSOperationInternal _start:] + 653
    8   Foundation                          0x00007fff91026613 __NSOQSchedule_f + 184
    9   libdispatch.dylib                   0x0000000100173d43 _dispatch_client_callout + 8
    10  libdispatch.dylib                   0x0000000100177fb3 _dispatch_queue_drain + 1804
    11  libdispatch.dylib                   0x0000000100179fc0 _dispatch_queue_invoke + 223
    12  libdispatch.dylib                   0x0000000100176f5e _dispatch_root_queue_drain + 666
    13  libdispatch.dylib                   0x0000000100188cd0 _dispatch_worker_thread3 + 106
    14  libsystem_pthread.dylib             0x00007fff935d4a9d _pthread_wqthread + 729
    15  libsystem_pthread.dylib             0x00007fff935d23dd start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException