Objective-C Corutin

Objective-C - how can I create an objective-c coroutine? When I have an IBAction called by a button, it freezes the application until IBAction completes the data extraction (from the website). How can I run this run as a coroutine for the main application?

Thanks Christian Stewart

+3
source share
2 answers

Contour is a special implementation method. What you want to do is work in the background without blocking your user interface.

There are two main methods on iOS and Mac OS X: running loops and threads.

URL- HTTP, , , , . URL concurrency , .

, , , NSOperationQueue NSOperatipn, GCD (dispatch_ *) NSThread. , , () ..

URL- NSURLDownload concurrency. , NSOperation.

+1

URL- URL.

, , NSURLConnection, URL- . /.

0

Source: https://habr.com/ru/post/1761844/


All Articles