sean7512 / RestEssentials

Lightweight REST and JSON library for Swift.
MIT License
37 stars 12 forks source link

[XC9][Warning] Main Thread Checker warning #15

Closed aravasio closed 6 years ago

aravasio commented 6 years ago

Since XC9 released I've been seeing this issue being printed on my debug console:

Main Thread Checker: UI API called on a background thread: -[UIApplication setNetworkActivityIndicatorVisible:]

After searching, I was unable to find a single instance of >setNetworkActivityIndicatorVisible

I'm just reporting this for reporting's sake. It's a warning and should be prioritized as such, but I think it's worth pointing it out. Me, personally, would consider it low priority if some other more critical issues show up, but given the nature of the warning itself (UI stuff on non-main threads), I'd still advice to address it as quickly as possible.

The debug stack is like this:

=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication setNetworkActivityIndicatorVisible:]
PID: 42219, TID: 2024360, Thread name: (none), Queue name: NSOperationQueue 0x600000224020 (QOS: UNSPECIFIED), QoS: 0
Backtrace:
4   RestEssentials                      0x000000010abbd001 _T014RestEssentials0A10ControllerC8dataTask33_91282727334FD93F32E0C59020D3A2CELLySSSg12relativePath_SS10httpMethodSS6acceptAA4JSONVSg4jsonAA0A7OptionsV7optionsyAA6ResultOy10Foundation4DataVG_So15HTTPURLResponseCSgtc8callbacktKFyAUSg_So11URLResponseCSgs5Error_pSgtcfU_ + 289
5   RestEssentials                      0x000000010abc28e8 _T014RestEssentials0A10ControllerC8dataTask33_91282727334FD93F32E0C59020D3A2CELLySSSg12relativePath_SS10httpMethodSS6acceptAA4JSONVSg4jsonAA0A7OptionsV7optionsyAA6ResultOy10Foundation4DataVG_So15HTTPURLResponseCSgtc8callbacktKFyAUSg_So11URLResponseCSgs5Error_pSgtcfU_TA + 216
6   RestEssentials                      0x000000010abbd6f7 _T010Foundation4DataVSgSo11URLResponseCSgs5Error_pSgIxxxx_So6NSDataCSgAGSo7NSErrorCSgIyByyy_TR + 263
7   CFNetwork                           0x000000011024c208 __75-[__NSURLSessionLocal taskForClass:request:uploadFile:bodyData:completion:]_block_invoke + 19
8   CFNetwork                           0x000000011024ba6d __49-[__NSCFLocalSessionTask _task_onqueue_didFinish]_block_invoke + 147
9   Foundation                          0x000000010d1c79b7 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
10  Foundation                          0x000000010d1c781a -[NSBlockOperation main] + 68
11  Foundation                          0x000000010d1c5cd6 -[__NSOperationInternal _start:] + 778
12  libdispatch.dylib                   0x000000010fd5443c _dispatch_client_callout + 8
13  libdispatch.dylib                   0x000000010fd59af4 _dispatch_block_invoke_direct + 592
14  libdispatch.dylib                   0x000000010fd5443c _dispatch_client_callout + 8
15  libdispatch.dylib                   0x000000010fd59af4 _dispatch_block_invoke_direct + 592
16  libdispatch.dylib                   0x000000010fd59884 dispatch_block_perform + 109
17  Foundation                          0x000000010d1c1ce4 __NSOQSchedule_f + 342
18  libdispatch.dylib                   0x000000010fd5443c _dispatch_client_callout + 8
19  libdispatch.dylib                   0x000000010fd5a856 _dispatch_continuation_pop + 967
20  libdispatch.dylib                   0x000000010fd58c86 _dispatch_async_redirect_invoke + 780
21  libdispatch.dylib                   0x000000010fd601f9 _dispatch_root_queue_drain + 772
22  libdispatch.dylib                   0x000000010fd5fe97 _dispatch_worker_thread3 + 132
23  libsystem_pthread.dylib             0x00000001102175a2 _pthread_wqthread + 1299
24  libsystem_pthread.dylib             0x000000011021707d start_wqthread + 13

If there's anything else I can help with, just tag me.

sean7512 commented 6 years ago

@aravasio This should have been resolved in 4.0.1, which is now available in cocoapods.

Please test that version and let me know if that fixes it.

aravasio commented 6 years ago

@sean7512 ok, did so and now I seem to have the same issue as #14. I went from a warning to an error. 🦆

sean7512 commented 6 years ago

@aravasio going to close this issue since 4.0.1 fixes it...

Will move convo to issue 14 (which I cannot reproduce)