Skip to Content
Beginning iOS 5 Application Development
book

Beginning iOS 5 Application Development

by Wei-Meng Lee
January 2012
Beginner content levelBeginner
655 pages
16h 35m
English
Wrox
Content preview from Beginning iOS 5 Application Development

SUMMARY

This chapter explained how to publish a service on the network using the NSNetService class and how to discover services on the local network using the NSNetServiceBrowser class. Once peers are discovered on the network, you can connect to them and initiate peer-to-peer communication. A chat application is a good example of a Bonjour application.

EXERCISES

  1. What class can you use to publish a service on the network?
  2. What class can you use to discover services on the network?
  3. Name the method that is called when a service is discovered.
  4. Name the method that is called when a service is removed.

    Answers to the exercises can be found in Appendix D.

image WHAT YOU LEARNED IN THIS CHAPTER

TOPIC KEY CONCEPTS
Publishing a service Use the NSNetService class.
Discovering services Use the NSNetServiceBrowser class.
Resolving the IP address of a service Use the resolveWithTimeout: method of an NSNetService object.
Getting the IP addresses of a service Use the addresses method of an NSNetService object.
Method that is called when a service is discovered netServiceBrowser:didFindService:moreComing:
Method that is called when a service is removed netServiceBrowser:didRemoveService:moreComing:
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering iOS 12 Programming - Third Edition

Mastering iOS 12 Programming - Third Edition

Donny Wals
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer

Publisher Resources

ISBN: 9781118144251Purchase book