2011-08-30 11 views

Odpowiedz

117

jak poniżej: [NSThread isMainThread]

+0

alternatywny sposób: - (Bool) IsMainThread { powrotu dispatch_get_main_queue() == dispatch_get_current_queue(); } –

+5

'dispatch_get_current_queue()' jest przestarzała jak iOS 6. –

+2

** Dla Swift 3 ** 'jeśli Thread.isMainThread { print ("Główny wątek") }' –

Powiązane problemy