Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 15. Networking > Using Queues for Blocking Checks

Using Queues for Blocking Checks

Use operation queues when working with blocking network calls. Listing 15-4 offers two use-case examples. In the first, a method runs a series of basic connectivity tests. The second method looks up IP addresses for Google and Amazon.

The connectivity method checks whether the iPhone or iPad 3G is connected to a cellular network (checked by Recipe 15-1’s activeWWAN method). If so, it launches a connection to whatismyip.com. It starts this process by initiating the application’s network activity indicator. This produces active feedback in the device’s status bar for an ongoing network operation.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial