Apple String Programming Guide Manuel Apple sur Fnac.com - Pour voir la liste complète des manuels APPLE, cliquez ici

 

 

TELECHARGER LE PDF sur :

http://developer.apple.com/library/mac/documentation/cocoa/conceptual/strings/strings.pdf

Commander un produit Apple sur Fnac.com

 

 

Voir également d'autres Guides APPLE :

Apple-Instrumentos_y_efectos_de_Logic_Studio.pdf-Manuel

Apple-ipod_nano_kayttoopas.pdf-Finlande-Manuel

Apple_ProRes_White_Paper_October_2012.pdf-Manuel

Apple-wp_osx_configuration_profiles.pdf-Manuel

Apple-UsingiTunesProducerFreeBooks.pdf-Manuel

Apple-ipad_manual_do_usuario.pdf-Portugais-Manuel

Apple-Instruments_et_effets_Logic_Studio.pdf-Manuel

Apple-ipod_touch_gebruikershandleiding.pdf-Neerlandais-Manuel

AppleiPod_shuffle_4thgen_Manual_del_usuario.pdf-Espagnol-Manuel

Apple-Premiers-contacts-avec-votre-PowerBook-G4-Manuel

Apple_Composite_AV_Cable.pdf-Manuel

Apple-iPod_shuffle_3rdGen_UG_DK.pdf-Danemark-Manuel

Apple-iPod_classic_160GB_Benutzerhandbuch.pdf-Allemand-Manuel

Apple-VoiceOver_GettingStarted-Manuel

Apple-iPod_touch_2.2_Benutzerhandbuch.pdf-Allemand-Manuel

Apple-Apple_TV_Opstillingsvejledning.pdf-Allemand-Manuel

Apple-iPod_shuffle_4thgen_Manuale_utente.pdf-Italie-Manuel

Apple-iphone_prirucka_uzivatela.pdf-Manuel

Apple-Aan-de-slag-Neerlandais-Manuel

Apple-airmac_express-80211n-2nd-gen_setup_guide.pdf-Thailande-Manuel

Apple-ipod_nano_benutzerhandbuch.pdf-Allemand-Manuel

Apple-aperture3.4_101.pdf-Manuel

Apple-Pages09_Anvandarhandbok.pdf-Manuel

Apple-nike_plus_ipod_sensor_ug_la.pdf-Mexique-Manuel

Apple-ResEdit-Reference-For-ResEdit02.1-Manuel

Apple-ipad_guide_de_l_utilisateur.pdf-Manuel

Apple-Compressor-4-Benutzerhandbuch-Allemand-Manuel

Apple-AirPort_Networks_Early2009_DK.pdf-Danemark-Manuel

Apple-MacBook_Pro_Mid2007_2.4_2.2GHz_F.pdf-Manuel

Apple-MacBook_13inch_Mid2010_UG_F.pdf-Manuel

Apple-Xserve-RAID-Presentation-technologique-Janvier-2004-Manuel

Apple-MacBook_Pro_15inch_Mid2010_F.pdf-Manuel

Apple-AirPort_Express-opstillingsvejledning.pdf-Danemark-Manuel

Apple-DEiPod_photo_Benutzerhandbuch_DE0190269.pdf-Allemand-Manuel

Apple-Final-Cut-Pro-X-Logic-Effects-Reference-Manuel

Apple-iPod_touch_2.1_Brugerhandbog.pdf-Danemark-Manuel

Apple-Remote-Desktop-Administratorhandbuch-Version-3.1-Allemand-Manuel

Apple-Qmaster-4-User-Manual-Manuel

Apple-Server_Administration_v10.5.pdf-Manuel

Apple-ipod_classic_features_guide.pdf-Manuel

Apple-Lecteur-Optique-Manuel

Apple-Carte-AirPort-Manuel

Apple-iPhone_Finger_Tips_Guide.pdf-Anglais-Manuel

Apple-Couvercle-Manuel

Apple-battery.cube.pdf-Manuel

Apple-Boitier-de-l-ordinateur-Manuel

Apple-Pile-Interne-Manuel

Apple-atacable.pdf-Manuel

Apple-videocard.pdf-Manuel

Apple-Guide_de_configuration_de_l_Airport_Express_5.1.pdf-Manuel

Apple-iMac_Mid2010_UG_F.pdf-Manuel

Apple-MacBook_13inch_Mid2009_F.pdf-Manuel

Apple-MacBook_Mid2007_UserGuide.F.pdf-Manuel

Apple-Designing_AirPort_Networks_10.5-Windows_F.pdf-Manuel

Apple-Administration_de_QuickTime_Streaming_et_Broadcasting_10.5.pdf-Manuel

Apple-Opstillingsvejledning_til_TimeCapsule.pdf-Danemark-Manuel

Apple-iPod_nano_5th_gen_Benutzerhandbuch.pdf-Manuel

Apple-iOS_Business.pdf-Manuel

Apple-AirPort_Extreme_Installationshandbuch.pdf-Manuel

Apple-Final_Cut_Express_4_Installation_de_votre_logiciel.pdf-Manuel

Apple-MacBook_Pro_15inch_2.53GHz_Mid2009.pdf-Manuel

Apple-Network_Services.pdf-Manuel

Apple-Aperture_Performing_Adjustments_f.pdf-Manuel

Apple-Supplement_au_guide_Premiers_contacts.pdf-Manuel

Apple-Administration_des_images_systeme_et_de_la_mise_a_jour_de_logiciels_10.5.pdf-Manuel

Apple-Mac_OSX_Server_v10.6_Premiers_contacts.pdf-Francais-Manuel

Apple-Designing_AirPort_Networks_10.5-Windows_F.pdf-Manuel

Apple-Mise_a_niveau_et_migration_v10.5.pdf-Manue

Apple-MacBookPro_Late_2007_2.4_2.2GHz_F.pdf-Manuel

Apple-Mac_mini_Late2009_SL_Server_F.pdf-Manuel

Apple-Mac_OS_X_Server_10.5_Premiers_contacts.pdf-Manuel

Apple-iPod_touch_2.0_Guide_de_l_utilisateur_CA.pdf-Manuel

Apple-MacBook_Pro_17inch_Mid2010_F.pdf-Manuel

Apple-Comment_demarrer_Leopard.pdf-Manuel

Apple-iPod_2ndGen_USB_Power_Adapter-FR.pdf-Manuel

Apple-Feuille_de_operations_10.4.pdf-Manuel

Apple-Time_Capsule_Installationshandbuch.pdf-Allemand-Manuel

Apple-F034-2262AXerve-grappe.pdf-Manuel

Apple-Mac_Pro_Early2009_4707_UG_F

Apple-imacg5_17inch_Power_Supply

Apple-Logic_Studio_Installieren_Ihrer_Software_Retail

Apple-IntroductionXserve1.0.1

Apple-Aperture_Getting_Started_d.pdf-Allemand

Apple-getting_started_with_passbook

Apple-iPod_mini_2nd_Gen_UserGuide.pdf-Anglais

Apple-Deploiement-d-iPhone-et-d-iPad-Reseaux-prives-virtuels

Apple-F034-2262AXerve-grappe

Apple-Mac_OS_X_Server_Glossaire_10.5

Apple-FRLogic_Pro_7_Guide_TDM

Apple-iphone_bluetooth_headset_userguide

Apple-Administration_des_services_reseau_10.5

Apple-imacg5_17inch_harddrive

Apple-iPod_nano_4th_gen_Manuale_utente

Apple-iBook-G4-Getting-Started

Apple-XsanGettingStarted

Apple-Mac_mini_UG-Early2006

Apple-Guide_des_fonctionnalites_de_l_iPod_classic

Apple-Guide_de_configuration_d_Xsan_2

Apple-MacBook_Late2006_UsersGuide

Apple-sur-Fnac.com

Apple-Mac_mini_Mid2010_User_Guide_F.pdf-Francais

Apple-PowerBookG3UserManual.PDF.Anglais

Apple-Installation_de_votre_logiciel_Logic_Studio_Retail

Apple-Pages-Guide-de-l-utilisateur

Apple-MacBook_Pro_13inch_Mid2009.pdf.Anglais

Apple-MacBook_Pro_15inch_Mid2009

Apple-Installation_de_votre_logiciel_Logic_Studio_Upgrade

Apple-FRLogic_Pro_7_Guide_TDM

Apple-airportextreme_802.11n_userguide

Apple-iPod_shuffle_3rdGen_UG

Apple-iPod_classic_160GB_User_Guide

Apple-iPod_nano_5th_gen_UserGuide

Apple-ipod_touch_features_guide

Apple-Wireless_Mighty_Mouse_UG

Apple-Advanced-Memory-Management-Programming-Guide

Apple-iOS-App-Programming-Guide

Apple-Concurrency-Programming-Guide

Apple-MainStage-2-User-Manual-Anglais

Apple-iMacG3_2002MultilingualUserGuide

Apple-iBookG3_DualUSBUserGuideMultilingual.PDF.Anglais

Apple-imacG5_20inch_AirPort

Apple-Guide_de_l_utilisateur_de_Mac_Pro_Early_2008

Apple-Installation_de_votre_logiciel_Logic_Express_8

Apple-iMac_Guide_de_l_utilisateur_Mid2007

Apple-imacg5_20inch_OpticalDrive

Apple-FCP6_Formats_de_diffusion_et_formats_HD

Apple-prise_en_charge_des_surfaces_de_controle_logic_pro_8

Apple-Aperture_Quick_Reference_f

Apple-Shake_4_User_Manual

Apple-aluminumAppleKeyboard_wireless2007_UserGuide

Apple-ipod_shuffle_features_guide

Apple-Color-User-Manual

Apple-XsanGettingStarted

Apple-Migration_10.4_2e_Ed

Apple-MacBook_Air_SuperDrive

Apple-MacBook_Late2007-f

ApplePowerMacG5_(Early_2005)_UserGuide

Apple-iSightUserGuide

Apple-MacBook_Pro_Early_2008_Guide_de_l_utilisateur

Apple-Nouvelles-fonctionnalites-aperture-1.5

Apple-premiers_contacts_2e_ed_10.4.pdf-Mac-OS-X-Server

Apple-premiers_contacts_2e_ed_10.4

Apple-eMac_2005UserGuide

Apple-imacg5_20inch_Inverter

Apple-Keynote2_UserGuide.pdf-Japon

Apple-Welcome_to_Tiger.pdf-Japon

Apple-XsanAdminGuide_j.pdf-Japon

Apple-PowerBookG4_UG_15GE.PDF-Japon

Apple-Xsan_Migration.pdf-Japon

Apple-Xserve_Intel_DIY_TopCover_JA.pdf-Japon

Apple-iPod_nano_6thgen_User_Guide_J.pdf-Japon

Apple-Aperture_Photography_Fundamentals.pdf-Japon

Apple-nikeipod_users_guide.pdf-Japon

Apple-QuickTime71_UsersGuide.pdf-Japon

Apple-iMacG5_iSight_UG.pdf-Japon

Apple-Aperture_Performing_Adjustments_j.pdf-Japon

Apple-iMacG5_17inch_HardDrive.pdf-Japon

Apple-iPod_shuffle_Features_Guide_J.pdf-Japon

Apple-MacBook_Air_User_Guide.pdf-Japon

Apple-MacBook_UsersGuide.pdf-Japon

Apple-iPad_iOS4_Brukerhandbok.pdf-Norge-Norvege

Apple-Apple_AirPort_Networks_Early2009_H.pd-Norge-Norvege

Apple-iPod_classic_120GB_no.pdf-Norge-Norvege

Apple-StoreKitGuide.pdf-Japon

Apple-Xserve_Intel_DIY_ExpansionCardRiser_JA.pdf-Japon

Apple-iMacG5_Battery.pdf-Japon

Apple-Logic_Pro_8_Getting_Started.pdf-Japon

Apple-PowerBook-handbok-Norge-Norveg

Apple-iWork09_formler_og_funksjoner.pdf-Norge-Norvege

Apple-MacBook_Pro_15inch_Mid2010_H.pdf-Norge-Norvege

Apple-MacPro_HardDrive_DIY.pdf-Japon

Apple-iPod_Fifth_Gen_Funksjonsoversikt.pdf-Norge-Norvege

Apple-MacBook_13inch_white_Early2009_H.pdf-Norge-Norvege

Apple-GarageBand_09_Komme_i_gang.pdf-Norge-Norvege

Apple-MacBook_Pro_15inch_Mid2009_H.pdf-Norge-Norvege

Apple-imac_mid2011_ug_h.pdf-Norge-Norvege

Apple-iDVD_08_Komme_i_gang.pdf-Norge-Norvege

Apple-MacBook_Air_11inch_Late2010_UG_H.pdf-Norge-Norvege

Apple-iMac_Mid2010_UG_H.pdf-Norge-Norvege

Apple-MacBook_13inch_Mid2009_H.pdf-Norge-Norvege

/Apple-iPhone_3G_Viktig_produktinformasjon_H-Norge-Norvege

Apple-MacBook_13inch_Mid2010_UG_H.pdf-Norge-Norvege

Apple-macbook_air_13inch_mid2011_ug_no.pdf-Norge-Norvege

Apple-Mac_mini_Early2009_UG_H.pdf-Norge-Norvege

Apple-ipad2_brukerhandbok.pdf-Norge-Norvege

Apple-iPhoto_08_Komme_i_gang.pdf-Norge-Norvege

Apple-MacBook_Air_Brukerhandbok_Late2008.pdf-Norge-Norvege

Apple-Pages09_Brukerhandbok.pdf-Norge-Norvege

Apple-MacBook_13inch_Late2009_UG_H.pdf-Norge-Norvege

Apple-iPhone_3GS_Viktig_produktinformasjon.pdf-Norge-Norvege

Apple-MacBook_13inch_Aluminum_Late2008_H.pdf-Norge-Norvege

Apple-Wireless_Keyboard_Aluminum_2007_H-Norge-Norvege

Apple-NiPod_photo_Brukerhandbok_N0190269.pdf-Norge-Norvege

Apple-MacBook_Pro_13inch_Mid2010_H.pdf-Norge-Norvege

Apple-MacBook_Pro_17inch_Mid2010_H.pdf-Norge-Norvege

Apple-Velkommen_til_Snow_Leopard.pdf-Norge-Norvege.htm

Apple-TimeCapsule_Klargjoringsoversikt.pdf-Norge-Norvege

Apple-iPhone_3GS_Hurtigstart.pdf-Norge-Norvege

Apple-Snow_Leopard_Installeringsinstruksjoner.pdf-Norge-Norvege

Apple-iMacG5_iSight_UG.pdf-Norge-Norvege

Apple-iPod_Handbok_S0342141.pdf-Norge-Norvege

Apple-ipad_brukerhandbok.pdf-Norge-Norvege

Apple-GE_Money_Bank_Handlekonto.pdf-Norge-Norvege

Apple-MacBook_Air_11inch_Late2010_UG_H.pdf-Norge-Norvege

Apple-iPod_nano_6thgen_Brukerhandbok.pdf-Norge-Norvege

Apple-iPod_touch_iOS4_Brukerhandbok.pdf-Norge-Norvege

Apple-MacBook_Air_13inch_Late2010_UG_H.pdf-Norge-Norvege

Apple-MacBook_Pro_15inch_Early2011_H.pdf-Norge-Norvege

Apple-Numbers09_Brukerhandbok.pdf-Norge-Norvege

Apple-Welcome_to_Leopard.pdf-Japon

Apple-PowerMacG5_UserGuide.pdf-Norge-Norvege

Apple-iPod_touch_2.1_Brukerhandbok.pdf-Norge-Norvege

Apple-Boot_Camp_Installering-klargjoring.pdf-Norge-Norvege

Apple-MacOSX10.3_Welcome.pdf-Norge-Norvege

Apple-iPod_shuffle_3rdGen_UG_H.pdf-Norge-Norvege

Apple-iPhone_4_Viktig_produktinformasjon.pdf-Norge-Norvege

Apple_TV_Klargjoringsoversikt.pdf-Norge-Norvege

Apple-iMovie_08_Komme_i_gang.pdf-Norge-Norvege

Apple-iPod_classic_160GB_Brukerhandbok.pdf-Norge-Norvege

Apple-Boot_Camp_Installering_10.6.pdf-Norge-Norvege

Apple-Network-Services-Location-Manager-Veiledning-for-nettverksadministratorer-Norge-Norvege

Apple-iOS_Business_Mar12_FR.pdf

Apple-PCIDualAttachedFDDICard.pdf

Apple-Aperture_Installing_Your_Software_f.pdf

Apple-User_Management_Admin_v10.4.pdf

Apple-Compressor-4-ユーザーズマニュアル Japon

Apple-Network_Services_v10.4.pdf

Apple-iPod_2ndGen_USB_Power_Adapter-DE

Apple-Mail_Service_v10.4.pdf

Apple-AirPort_Express_Opstillingsvejledning_5.1.pdf

Apple-MagSafe_Airline_Adapter.pdf

Apple-L-Apple-Multiple-Scan-20-Display

Apple-Administration_du_service_de_messagerie_10.5.pdf

Apple-System_Image_Admin.pdf

Apple-iMac_Intel-based_Late2006.pdf-Japon

Apple-iPhone_3GS_Finger_Tips_J.pdf-Japon

Apple-Power-Mac-G4-Mirrored-Drive-Doors-Japon

Apple-AirMac-カード取り付け手順-Japon

Apple-iPhone開発ガイド-Japon

Apple-atadrive_pmg4mdd.j.pdf-Japon

Apple-iPod_touch_2.2_User_Guide_J.pdf-Japon

Apple-Mac_OS_X_Server_v10.2.pdf

Apple-AppleCare_Protection_Plan_for_Apple_TV.pdf

Apple_Component_AV_Cable.pdf

Apple-DVD_Studio_Pro_4_Installation_de_votre_logiciel

Apple-Windows_Services

Apple-Motion_3_New_Features_F

Apple-g4mdd-fw800-lowerfan

Apple-MacOSX10.3_Welcome

Apple-Print_Service

Apple-Xserve_Setup_Guide_F

Apple-PowerBookG4_17inch1.67GHzUG

Apple-iMac_Intel-based_Late2006

Apple-Installation_de_votre_logiciel

Apple-guide_des_fonctions_de_l_iPod_nano

Apple-Administration_de_serveur_v10.5

Apple-Mac-OS-X-Server-Premiers-contacts-Pour-la-version-10.3-ou-ulterieure

Apple-boot_camp_install-setup

Apple-iBookG3_14inchUserGuideMultilingual

Apple-mac_pro_server_mid2010_ug_f

Apple-Motion_Supplemental_Documentation

Apple-imac_mid2011_ug_f

Apple-iphone_guide_de_l_utilisateur

Apple-macbook_air_11inch_mid2011_ug_fr

Apple-NouvellesfonctionnalitesdeLogicExpress7.2

Apple-QT_Streaming_Server

Apple-Web_Technologies_Admin

Apple-Mac_Pro_Early2009_4707_UG

Apple-guide_de_l_utilisateur_de_Numbers08

Apple-Decouverte_d_Aperture_2

Apple-Guide_de_configuration_et_d'administration

Apple-mac_integration_basics_fr_106.

Apple-iPod_shuffle_4thgen_Guide_de_l_utilisateur

Apple-ARA_Japan

Apple-081811_APP_iPhone_Japanese_v5.4.pdf-Japan

Apple-Recycle_Contract120919.pdf-Japan

Apple-World_Travel_Adapter_Kit_UG

Apple-iPod_nano_6thgen_User_Guide

Apple-RemoteSupportJP

Apple-Mac_mini_Early2009_UG_F.pdf-Manuel-de-l-utilisateur

Apple-Compressor_3_Batch_Monitor_User_Manual_F.pdf-Manuel-de-l-utilisateur

Apple-Premiers__contacts_avec_iDVD_08

Apple-Mac_mini_Intel_User_Guide.pdf

Apple-Prise_en_charge_des_surfaces_de_controle_Logic_Express_8

Apple-mac_integration_basics_fr_107.pdf

Apple-Final-Cut-Pro-7-Niveau-1-Guide-de-preparation-a-l-examen

Apple-Logic9-examen-prep-fr.pdf-Logic-Pro-9-Niveau-1-Guide-de-preparation-a-l-examen

Apple-aperture_photography_fundamentals.pdf-Manuel-de-l-utilisateu

Apple-emac-memory.pdf-Manuel-de-l-utilisateur

Apple-Apple-Installation-et-configuration-de-votre-Power-Mac-G4

Apple-Guide_de_l_administrateur_d_Xsan_2.pdf

Apple-premiers_contacts_avec_imovie6.pdf

Apple-Tiger_Guide_Installation_et_de_configuration.pdf

Apple-Final-Cut-Pro-7-Level-One-Exam-Preparation-Guide-and-Practice-Exam

Apple-Open_Directory.pdf

Apple-Nike_+_iPod_User_guide

Apple-ard_admin_guide_2.2_fr.pdf

Apple-systemoverviewj.pdf-Japon

Apple-Xserve_TO_J070411.pdf-Japon

Apple-Mac_Pro_User_Guide.pdf

Apple-iMacG5_iSight_UG.pdf

Apple-premiers_contacts_avec_iwork_08.pdf

Apple-services_de_collaboration_2e_ed_10.4.pdf

Apple-iPhone_Bluetooth_Headset_Benutzerhandbuch.pdf

Apple-Guide_de_l_utilisateur_de_Keynote08.pdf

APPLE/Apple-Logic-Pro-9-Effectsrfr.pdf

Apple-Logic-Pro-9-Effectsrfr.pdf

Apple-iPod_shuffle_3rdGen_UG_F.pdf

Apple-iPod_classic_160Go_Guide_de_l_utilisateur.pdf

Apple-iBookG4GettingStarted.pdf

Apple-Administration_de_technologies_web_10.5.pdf

Apple-Compressor-4-User-Manual-fr

Apple-MainStage-User-Manual-fr.pdf

Apple-Logic_Pro_8.0_lbn_j.pdf

Apple-PowerBookG4_15inch1.67-1.5GHzUserGuide.pdf

Apple-MacBook_Pro_15inch_Mid2010_CH.pdf

Apple-LED_Cinema_Display_27-inch_UG.pdf

Apple-MacBook_Pro_15inch_Mid2009_RS.pdf

Apple-macbook_pro_13inch_early2011_f.pdf

Apple-iMac_Mid2010_UG_BR.pdf

Apple-iMac_Late2009_UG_J.pdf

Apple-iphone_user_guide-For-iOS-6-Software

Apple-iDVD5_Getting_Started.pdf

Apple-guide_des_fonctionnalites_de_l_ipod_touch.pdf

Apple_iPod_touch_User_Guide

Apple_macbook_pro_13inch_early2011_f

Apple_Guide_de_l_utilisateur_d_Utilitaire_RAID

Apple_Time_Capsule_Early2009_Setup_F

Apple_iphone_4s_finger_tips_guide_rs

Apple_iphone_upute_za_uporabu

Apple_ipad_user_guide_ta

Apple_iPod_touch_User_Guide

apple_earpods_user_guide

apple_iphone_gebruikershandleiding

apple_iphone_5_info

apple_iphone_brukerhandbok

apple_apple_tv_3rd_gen_setup_tw

apple_macbook_pro-retina-mid-2012-important_product_info_ch

apple_Macintosh-User-s-Guide-for-Macintosh-PowerBook-145

Apple_ipod_touch_user_guide_ta

Apple_TV_2nd_gen_Setup_Guide_h

Apple_ipod_touch_manual_del_usuario

Apple_iphone_4s_finger_tips_guide_tu

Apple_macbook_pro_retina_qs_th

Apple-Manuel_de_l'utilisateur_de_Final_Cut_Server

Apple-iMac_G5_de_lutilisateur

Apple-Cinema_Tools_4.0_User_Manual_F

Apple-Personal-LaserWriter300-User-s-Guide

Apple-QuickTake-100-User-s-Guide-for-Macintosh

Apple-User-s-Guide-Macintosh-LC-630-DOS-Compatible

Apple-iPhone_iOS3.1_User_Guide

Apple-iphone_4s_important_product_information_guide

Apple-iPod_shuffle_Features_Guide_F

Liste-documentation-apple

Apple-Premiers_contacts_avec_iMovie_08

Apple-macbook_pro-retina-mid-2012-important_product_info_br

Apple-macbook_pro-13-inch-mid-2012-important_product_info

Apple-macbook_air-11-inch_mid-2012-qs_br

Apple-Manuel_de_l_utilisateur_de_MainStage

Apple-Compressor_3_User_Manual_F

Apple-Color_1.0_User_Manual_F

Apple-guide_de_configuration_airport_express_4.2

Apple-TimeCapsule_SetupGuide

Apple-Instruments_et_effets_Logic_Express_8

Apple-Manuel_de_l_utilisateur_de_WaveBurner

Apple-Macmini_Guide_de_l'utilisateur

Apple-PowerMacG5_UserGuide

Disque dur, ATA parallèle Instructions de remplacement

Apple-final_cut_pro_x_logic_effects_ref_f

Apple-Leopard_Installationshandbok

Manuale Utente PowerBookG4

Apple-thunderbolt_display_getting_started_1e

Apple-Compressor-4-Benutzerhandbuch

Apple-macbook_air_11inch_mid2011_ug

Apple-macbook_air-mid-2012-important_product_info_j

Apple-iPod-nano-Guide-des-fonctionnalites

Apple-iPod-nano-Guide-des-fonctionnalites

Apple-iPod-nano-Guide-de-l-utilisateur-4eme-generation

Apple-iPod-nano-Guide-de-l-utilisateur-4eme-generation

Apple-Manuel_de_l_utilisateur_d_Utilitaire_de_reponse_d_impulsion

Apple-Aperture_2_Raccourcis_clavier

AppleTV_Setup-Guide

Apple-livetype_2_user_manual_f

Apple-imacG5_17inch_harddrive

Apple-macbook_air_guide_de_l_utilisateur

Apple-MacBook_Early_2008_Guide_de_l_utilisateur

Apple-Keynote-2-Guide-de-l-utilisateur

Apple-PowerBook-User-s-Guide-for-PowerBook-computers

Apple-Macintosh-Performa-User-s-Guide-5200CD-and-5300CD

Apple-Macintosh-Performa-User-s-Guide

Apple-Workgroup-Server-Guide

Apple-iPod-nano-Guide-des-fonctionnalites

Apple-iPad-User-Guide-For-iOS-5-1-Software

Apple-Boot-Camp-Guide-d-installation-et-de-configuration

Apple-iPod-nano-Guide-de-l-utilisateur-4eme-generation

Power Mac G5 Guide de l’utilisateur APPLE

Guide de l'utilisateur PAGE '08 APPLE

Guide de l'utilisateur KEYNOTE '09 APPLE

Guide de l'Utilisateur KEYNOTE '3 APPLE

Guide de l'Utilisateur UTILITAIRE RAID

Guide de l'Utilisateur Logic Studio

Power Mac G5 Guide de l’utilisateur APPLE

Guide de l'utilisateur PAGE '08 APPLE

Guide de l'utilisateur KEYNOTE '09 APPLE

Guide de l'Utilisateur KEYNOTE '3 APPLE

Guide de l'Utilisateur UTILITAIRE RAID

Guide de l'Utilisateur Logic Studio

Guide de l’utilisateur ipad Pour le logiciel iOS 5.1

PowerBook G4 Premiers Contacts APPLE

Guide de l'Utilisateur iphone pour le logiciel ios 5.1 APPLE

Guide de l’utilisateur ipad Pour le logiciel iOS 4,3

Guide de l’utilisateur iPod nano 5ème génération

Guide de l'utilisateur iPod Touch 2.2 APPLE

Guide de l’utilisateur QuickTime 7  Mac OS X 10.3.9 et ultérieur Windows XP et Windows 2000

Guide de l'utilisateur MacBook 13 pouces Mi 2010

Guide de l’utilisateur iPhone (Pour les logiciels iOS 4.2 et 4.3)

Guide-de-l-utilisateur-iPod-touch-pour-le-logiciel-ios-4-3-APPLE

Guide-de-l-utilisateur-iPad-2-pour-le-logiciel-ios-4-3-APPLE

Guide de déploiement en entreprise iPhone OS

Guide-de-l-administrateur-Apple-Remote-Desktop-3-1

Guide-de-l-utilisateur-Apple-Xserve-Diagnostics-Version-3X103

Guide-de-configuration-AirPort-Extreme-802.11n-5e-Generation

Guide-de-configuration-AirPort-Extreme-802-11n-5e-Generation

Guide-de-l-utilisateur-Capteur-Nike-iPod

Guide-de-l-utilisateur-iMac-21-5-pouces-et-27-pouces-mi-2011-APPLE

Guide-de-l-utilisateur-Apple-Qadministrator-4

Guide-d-installation-Apple-TV-3-eme-generation

User-Guide-iPad-For-ios-5-1-Software

String Programming GuideContents Introduction to String Programming Guide for Cocoa 5 Who Should Read This Document 5 Organization of This Document 5 See Also 6 Strings 7 Creating and Converting String Objects 8 Creating Strings 8 NSString from C Strings and Data 8 Variable Strings 9 Strings to Present to the User 10 Combining and Extracting Strings 10 Getting C Strings 11 Conversion Summary 12 Formatting String Objects 13 Formatting Basics 13 Strings and Non-ASCII Characters 14 NSLog and NSLogv 14 String Format Specifiers 15 Format Specifiers 15 Platform Dependencies 17 Reading Strings From and Writing Strings To Files and URLs 19 Reading From Files and URLs 19 Reading data with a known encoding 19 Reading data with an unknown encoding 20 Writing to Files and URLs 21 Summary 21 Searching, Comparing, and Sorting Strings 22 Search and Comparison Methods 22 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 2Searching strings 22 Comparing and sorting strings 23 Search and Comparison Options 24 Examples 24 Case-Insensitive Search for Prefix and Suffix 24 Comparing Strings 25 Sorting strings like Finder 26 Paragraphs and Line Breaks 28 Line and Paragraph Separator Characters 28 Separating a String “by Paragraph” 28 Characters and Grapheme Clusters 30 Character Sets 33 Character Set Basics 33 Creating Character Sets 33 Performance considerations 34 Creating a character set file 35 Standard Character Sets and Unicode Definitions 35 Scanners 36 Creating a Scanner 36 Using a Scanner 36 Example 38 Localization 39 String Representations of File Paths 40 Representing a Path 40 User Directories 41 Path Components 42 File Name Completion 43 Drawing Strings 44 Document Revision History 45 Index 47 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 3Tables String Format Specifiers 15 Table 1 Format specifiers supported by the NSString formatting methods and CFString formatting functions 15 Table 2 Length modifiers supported by the NSString formatting methods and CFString formatting functions 16 Table 3 Format specifiers for data types 17 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 4String Programming Guide for Cocoa describes how to create, search, concatenate, and draw strings. It also describes character sets, which let you search a string for characters in a group, and scanners, which convert numbers to strings and vice versa. Who Should Read This Document You should read this document if you need to work directly with strings or character sets. Organization of This Document This document contains the following articles: ● “Strings” (page 7) describes the characteristics of string objects in Cocoa. ● “Creating and Converting String Objects” (page 8) explains the ways in which NSString and its subclass NSMutableString create string objects and convert their contents to and from the various character encodings they support. ● “Formatting String Objects” (page 13) describes how to format NSString objects. ● “String Format Specifiers” (page 15) describes printf-style format specifiers supported by NSString. ● “Reading Strings From and Writing Strings To Files and URLs” (page 19) describes how to read strings from and write strings to files and URLs. ● “Searching, Comparing, and Sorting Strings” (page 22) describes methods for finding characters and substrings within strings and for comparing one string to another. ● “Paragraphs and Line Breaks” (page 28) describes how paragraphs and line breaks are represented. ● “Characters and Grapheme Clusters” (page 30) describes how you can break strings down into user-perceived characters. ● “Character Sets” (page 33) explains how to use character set objects, and how to use NSCharacterSet methods to create standard and custom character sets. ● “Scanners” (page 36) describes NSScanner objects, which interpret and convert the characters of an NSString object into number and string values. 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 5 Introduction to String Programming Guide for Cocoa● “String Representations of File Paths” (page 40) describes the NSString methods that manipulate strings as file-system paths. ● “Drawing Strings” (page 44) discusses the methods of the NSString class that support drawing directly in an NSView object. See Also For more information, refer to the following documents: ● Attributed String Programming Guide is closely related to String Programming Guide for Cocoa . It provides information about NSAttributedString objects, which manage sets of attributes, such as font and kerning, that are associated with character strings or individual characters. ● Data Formatting Guide describes how to format data using objects that create, interpret, and validate text. ● Internationalization Programming Topics provides information about localizing strings in your project, including information on how string formatting arguments can be ordered. ● String Programming Guide for Core Foundation in Core Foundation, discussesthe Core Foundation opaque type CFString, which is toll-free bridged with the NSString class. Introduction to String Programming Guide for Cocoa See Also 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 6String objects represent character strings in Cocoa frameworks. Representing strings as objects allows you to use strings wherever you use other objects. It also providesthe benefits of encapsulation,so thatstring objects can use whatever encoding and storage is needed for efficiency while simply appearing as arrays of characters. A string object is implemented as an array of Unicode characters (in other words, a text string). An immutable string is a text string that is defined when it is created and subsequently cannot be changed. To create and manage an immutable string, use the NSString class. To construct and manage a string that can be changed after it has been created, use NSMutableString. The objects you create using NSString and NSMutableString are referred to as string objects (or, when no confusion will result, merely as strings). The term C string refers to the standard C char * type. A string object presents itself as an array of Unicode characters. You can determine how many characters it contains with the length method and can retrieve a specific character with the characterAtIndex: method. These two “primitive” methods provide basic access to a string object. Most use of strings, however, is at a higher level, with the strings being treated as single entities: You compare strings against one another, search them for substrings, combine them into new strings, and so on. If you need to access string objects character-by-character, you must understand the Unicode character encoding—specifically, issues related to composed character sequences. For details see: ● The Unicode Standard, Version 4.0 . The Unicode Consortium. Boston: Addison-Wesley, 2003. ISBN 0-321-18578-1. ● The Unicode Consortium web site: http://www.unicode.org/. 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 7 StringsNSString and its subclass NSMutableString provide several ways to create string objects, most based around the various character encodingsitsupports. Although string objects always present their own contents as Unicode characters, they can convert their contents to and from many other encodings, such as 7-bit ASCII, ISO Latin 1, EUC, and Shift-JIS. The availableStringEncodings class method returns the encodings supported. You can specify an encoding explicitly when converting a C string to or from a string object, or use the default C string encoding, which varies from platform to platform and is returned by the defaultCStringEncoding class method. Creating Strings The simplest way to create a string object in source code is to use the Objective-C @"..." construct: NSString *temp = @"Contrafibularity"; Note that, when creating a string constant in this fashion, you should use UTF-8 characters. Such an object is created at compile time and exists throughout your program’s execution. The compiler makes such object constants unique on a per-module basis, and they’re never deallocated. You can also send messages directly to a string constant as you do any other string: BOOL same = [@"comparison" isEqualToString:myString]; NSString from C Strings and Data To create an NSString object from a C string, you use methods such as initWithCString:encoding:. You must correctly specify the character encoding of the C string. Similar methods allow you to create string objects from characters in a variety of encodings. The method initWithData:encoding: allows you to convert string data stored in an NSData object into an NSString object. char *utf8String = /* Assume this exists. */ ; NSString *stringFromUTFString = [[NSString alloc] initWithUTF8String:utf8String]; 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 8 Creating and Converting String Objectschar *macOSRomanEncodedString = /* assume this exists */ ; NSString *stringFromMORString = [[NSString alloc] initWithCString:macOSRomanEncodedString encoding:NSMacOSRomanStringEncoding]; NSData *shiftJISData = /* assume this exists */ ; NSString *stringFromShiftJISData = [[NSString alloc] initWithData:shiftJISData encoding:NSShiftJISStringEncoding]; The following example converts an NSString object containing a UTF-8 character to ASCII data then back to an NSString object. unichar ellipsis = 0x2026; NSString *theString = [NSString stringWithFormat:@"To be continued%C", ellipsis]; NSData *asciiData = [theString dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; NSString *asciiString = [[NSString alloc] initWithData:asciiData encoding:NSASCIIStringEncoding]; NSLog(@"Original: %@ (length %d)", theString, [theString length]); NSLog(@"Converted: %@ (length %d)", asciiString, [asciiString length]); // output: // Original: To be continued… (length 16) // Converted: To be continued... (length 18) Variable Strings To create a variable string, you typically use stringWithFormat:: or initWithFormat: (or for localized strings, localizedStringWithFormat:). These methods and theirsiblings use a formatstring as a template into which the values you provide (string and other objects, numerics values, and so on) are inserted. They and the supported format specifiers are described in “Formatting String Objects” (page 13). Creating and Converting String Objects Creating Strings 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 9You can build a string from existing string objects using the methods stringByAppendingString: and stringByAppendingFormat: to create a new string by adding one string after another, in the second case using a format string. NSString *hString = @"Hello"; NSString *hwString = [hString stringByAppendingString:@", world!"]; Strings to Present to the User When creating strings to present to the user, you should consider the importance of localizing your application. In general, you should avoid creating user-visible strings directly in code. Instead you should use strings in your code as a key to a localization dictionary that will supply the user-visible string in the user's preferred language. Typically thisinvolves using NSLocalizedString and similar macros, asillustrated in the following example. NSString *greeting = NSLocalizedStringFromTable (@"Hello", @"greeting to present in first launch panel", @"greetings"); For more about internationalizing your application, see Internationalization Programming Topics. “Localizing String Resources” describes how to work with and reorder variable arguments in localized strings. Combining and Extracting Strings You can combine and extract strings in various ways. The simplest way to combine two strings is to append one to the other. The stringByAppendingString: method returns a string object formed from the receiver and the given argument. NSString *beginning = @"beginning"; NSString *alphaAndOmega = [beginning stringByAppendingString:@" and end"]; // alphaAndOmega is @"beginning and end" You can also combine several strings according to a template with the initWithFormat:, stringWithFormat:, and stringByAppendingFormat: methods; these are described in more detail in “Formatting String Objects” (page 13). Creating and Converting String Objects Combining and Extracting Strings 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 10You can extract substrings from the beginning or end of a string to a particular index, or from a specific range, with the substringToIndex:, substringFromIndex:, and substringWithRange: methods. You can also split a string into substrings (based on a separator string) with the componentsSeparatedByString: method. These methods are illustrated in the following examples—notice that the index of the index-based methods starts at 0: NSString *source = @"0123456789"; NSString *firstFour = [source substringToIndex:4]; // firstFour is @"0123" NSString *allButFirstThree = [source substringFromIndex:3]; // allButFirstThree is @"3456789" NSRange twoToSixRange = NSMakeRange(2, 4); NSString *twoToSix = [source substringWithRange:twoToSixRange]; // twoToSix is @"2345" NSArray *split = [source componentsSeparatedByString:@"45"]; // split contains { @"0123", @"6789" } If you need to extract strings using pattern-matching rather than an index, you should use a scanner—see “Scanners” (page 36). Getting C Strings To get a C string from a string object, you are recommended to use UTF8String. This returns a const char * using UTF8 string encoding. const char *cString = [@"Hello, world" UTF8String]; The C string you receive is owned by a temporary object, and will become invalid when automatic deallocation takes place. If you want to get a permanent C string, you must create a buffer and copy the contents of the const char * returned by the method. Similar methods allow you to create string objects from characters in the Unicode encoding or an arbitrary encoding, and to extract data in these encodings. initWithData:encoding: and dataUsingEncoding: perform these conversions from and to NSData objects. Creating and Converting String Objects Getting C Strings 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 11Conversion Summary This table summarizes the most common means of creating and converting string objects: Source Creation method Extraction method In code @"..." compiler construct N/A UTF8 encoding stringWithUTF8String: UTF8String getCharacters: getCharacters:range: Unicode encoding stringWithCharacters: length: Arbitrary encoding initWithData: encoding: dataUsingEncoding: stringByAppendingString: N/A stringByAppendingFormat: Existing strings localizedStringWithFormat: Use NSScanner initWithFormat: locale: Format string Localized strings NSLocalizedString and similar N/A Creating and Converting String Objects Conversion Summary 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 12This article describes how to create a string using a format string, how to use non-ASCII characters in a format string, and a common error that developers make when using NSLog or NSLogv. Formatting Basics NSString uses a format string whose syntax is similar to that used by other formatter objects. It supports the format characters defined for the ANSI C function printf(), plus %@ for any object (see “String Format Specifiers” (page 15) and the IEEE printf specification). If the object responds to descriptionWithLocale: messages, NSString sends such a message to retrieve the text representation. Otherwise, it sends a description message. “Localizing String Resources” describes how to work with and reorder variable arguments in localized strings. In formatstrings, a ‘%’ character announces a placeholder for a value, with the charactersthat follow determining the kind of value expected and how to format it. For example, a format string of "%d houses" expects an integer value to be substituted for the format expression '%d'. NSString supportsthe format characters defined for the ANSI C functionprintf(), plus ‘@’ for any object. If the object responds to the descriptionWithLocale: message, NSString sends that message to retrieve the text representation, otherwise, it sends a description message. Value formatting is affected by the user’s current locale, which is an NSDictionary object that specifies number, date, and other kinds of formats. NSString uses only the locale’s definition for the decimal separator (given by the key named NSDecimalSeparator). If you use a method that doesn’t specify a locale, the string assumes the default locale. You can use NSString’s stringWithFormat: method and other related methods to create strings with printf-style formatspecifiers and argument lists, as described in “Creating and Converting StringObjects” (page 8). The examples below illustrate how you can create a string using a variety of formatspecifiers and arguments. NSString *string1 = [NSString stringWithFormat:@"A string: %@, a float: %1.2f", @"string", 31415.9265]; // string1 is "A string: string, a float: 31415.93" NSNumber *number = @1234; 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 13 Formatting String ObjectsNSDictionary *dictionary = @{ [NSDate date]:@"date" }; NSString *baseString = @"Base string."; NSString *string2 = [baseString stringByAppendingFormat: @" A number: %@, a dictionary: %@", number, dictionary]; // string2 is "Base string. A number: 1234, a dictionary: {date = 2005-10-17 09:02:01 -0700; }" Strings and Non-ASCII Characters You can include non-ASCII characters(including Unicode) in strings usingmethodssuch as stringWithFormat: and stringWithUTF8String:. NSString *s = [NSString stringWithFormat:@"Long %C dash", 0x2014]; Since \xe2\x80\x94 is the 3-byte UTF-8 string for 0x2014, you could also write: NSString *s = [NSString stringWithUTF8String:"Long \xe2\x80\x94 dash"]; NSLog and NSLogv The utility functions NSLog() and NSLogv() use the NSString string formatting servicesto log error messages. Note that as a consequence of this, you should take care when specifying the argument for these functions. A common mistake isto specify a string that includesformatting characters, asshown in the following example. NSString *string = @"A contrived string %@"; NSLog(string); // The application will probably crash here due to signal 10 (SIGBUS) It is better (safer) to use a format string to output another string, as shown in the following example. NSString *string = @"A contrived string %@"; NSLog(@"%@", string); // Output: A contrived string %@ Formatting String Objects Strings and Non-ASCII Characters 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 14This article summarizes the format specifiers supported by string formatting methods and functions. Format Specifiers The format specifiers supported by the NSString formatting methods and CFString formatting functions follow the IEEE printf specification; the specifiers are summarized in Table 1 (page 15). Note that you can also use the “n$” positional specifiers such as %1$@ %2$s. For more details, see the IEEE printf specification. You can also use these format specifiers with the NSLog function. Table 1 Format specifiers supported by the NSString formatting methods and CFString formatting functions Specifier Description Objective-C object, printed as the string returned by descriptionWithLocale: if available, or description otherwise. Also works with CFTypeRef objects, returning the result of the CFCopyDescription function. %@ %% '%' character. %d, %D Signed 32-bit integer (int). %u, %U Unsigned 32-bit integer (unsigned int). Unsigned 32-bit integer (unsigned int), printed in hexadecimal using the digits 0–9 and lowercase a–f. %x Unsigned 32-bit integer (unsigned int), printed in hexadecimal using the digits 0–9 and uppercase A–F. %X %o, %O Unsigned 32-bit integer (unsigned int), printed in octal. %f 64-bit floating-point number (double). 64-bit floating-point number (double), printed in scientific notation using a lowercase e to introduce the exponent. %e 64-bit floating-point number (double), printed in scientific notation using an uppercase E to introduce the exponent. %E 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 15 String Format SpecifiersSpecifier Description 64-bit floating-point number (double), printed in the style of %e if the exponent is less than –4 or greater than or equal to the precision, in the style of %f otherwise. %g 64-bit floating-point number (double), printed in the style of %E if the exponent is less than –4 or greater than or equal to the precision, in the style of %f otherwise. %G 8-bit unsigned character (unsigned char), printed by NSLog() as an ASCII character, or, if not an ASCII character, in the octal format \\ddd or the Unicode hexadecimal format \\udddd, where d is a digit. %c 16-bit Unicode character (unichar), printed by NSLog() as an ASCII character, or, if not an ASCII character, in the octal format \\ddd or the Unicode hexadecimal format \\udddd, where d is a digit. %C Null-terminated array of 8-bit unsigned characters. Because the %s specifier causes the characters to be interpreted in the system default encoding, the results can be variable, especially with right-to-left languages. For example, with RTL, %s inserts direction markers when the characters are not strongly directional. For this reason, it’s best to avoid %s and specify encodings explicitly. %s %S Null-terminated array of 16-bit Unicode characters. Void pointer (void *), printed in hexadecimal with the digits 0–9 and lowercase a–f, with a leading 0x. %p 64-bit floating-point number (double), printed in scientific notation with a leading 0x and one hexadecimal digit before the decimal point using a lowercase p to introduce the exponent. %a 64-bit floating-point number (double), printed in scientific notation with a leading 0X and one hexadecimal digit before the decimal point using a uppercase P to introduce the exponent. %A %F 64-bit floating-point number (double), printed in decimal notation. Table 2 Length modifiers supported by the NSString formatting methods and CFString formatting functions Length Description modifier Length modifier specifying that a following d, o, u, x, or X conversion specifier applies to a short or unsigned short argument. h Length modifier specifying that a following d, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument. hh String Format Specifiers Format Specifiers 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 16Length Description modifier Length modifier specifying that a following d, o, u, x, or X conversion specifier applies to a long or unsigned long argument. l Length modifiers specifying that a following d, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument. ll, q Length modifier specifying that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. L Length modifier specifying that a following d, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument. z Length modifier specifying that a following d, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned integer type argument. t Length modifier specifying that a following d, o, u, x, or X conversion specifier applies to a intmax_t or uintmax_t argument. j Platform Dependencies OS X uses several data types—NSInteger, NSUInteger,CGFloat, and CFIndex—to provide a consistent means of representing values in 32- and 64-bit environments. In a 32-bit environment, NSInteger and NSUInteger are defined as int and unsigned int, respectively. In 64-bit environments, NSInteger and NSUInteger are defined as long and unsigned long, respectively. To avoid the need to use different printf-style type specifiers depending on the platform, you can use the specifiers shown in Table 3. Note that in some cases you may have to cast the value. Table 3 Format specifiers for data types Type Format specifier Considerations NSInteger %ld or %lx Cast the value to long. NSUInteger %lu or %lx Cast the value to unsigned long. %f works for floats and doubles when formatting; but note the technique described below for scanning. CGFloat %f or %g CFIndex %ld or %lx The same as NSInteger. %p adds 0x to the beginning of the output. If you don't want that, use %zx and no typecast. pointer %p or %zx String Format Specifiers Platform Dependencies 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 17The following example illustrates the use of %ld to format an NSInteger and the use of a cast. NSInteger i = 42; printf("%ld\n", (long)i); In addition to the considerations mentioned in Table 3, there is one extra case with scanning: you must distinguish the types for float and double. You should use %f for float, %lf for double. If you need to use scanf (or a variant thereof) with CGFloat, switch to double instead, and copy the double to CGFloat. CGFloat imageWidth; double tmp; sscanf (str, "%lf", &tmp); imageWidth = tmp; It is important to remember that %lf does not represent CGFloat correctly on either 32- or 64-bit platforms. This is unlike %ld, which works for long in all cases. String Format Specifiers Platform Dependencies 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 18Reading files or URLs using NSString is straightforward provided that you know what encoding the resource uses—if you don't know the encoding, reading a resource is more challenging. When you write to a file or URL, you must specify the encoding to use. (Where possible, you should use URLs because these are more efficient.) Reading From Files and URLs NSString provides a variety of methods to read data from files and URLs. In general, it is much easier to read data if you know its encoding. If you have plain text and no knowledge of the encoding, you are already in a difficult position. You should avoid placing yourself in this position if at all possible—anything that calls for the use of plain text files should specify the encoding (preferably UTF-8 or UTF-16+BOM). Reading data with a known encoding To read from a file or URL for which you know the encoding, you use stringWithContentsOfFile:encoding:error: or stringWithContentsOfURL:encoding:error:, or the corresponding init... method, as illustrated in the following example. NSURL *URL = ...; NSError *error; NSString *stringFromFileAtURL = [[NSString alloc] initWithContentsOfURL:URL encoding:NSUTF8StringEncoding error:&error]; if (stringFromFileAtURL == nil) { // an error occurred NSLog(@"Error reading file at %@\n%@", URL, [error localizedFailureReason]); // implementation continues ... You can also initialize a string using a data object, as illustrated in the following examples. Again, you must specify the correct encoding. 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 19 Reading Strings From and Writing Strings To Files and URLsNSURL *URL = ...; NSData *data = [NSData dataWithContentsOfURL:URL]; // Assuming data is in UTF8. NSString *string = [NSString stringWithUTF8String:[data bytes]]; // if data is in another encoding, for example ISO-8859-1 NSString *string = [[NSString alloc] initWithData:data encoding: NSISOLatin1StringEncoding]; Reading data with an unknown encoding If you find yourself with text of unknown encoding, it is best to make sure that there is a mechanism for correcting the inevitable errors. For example, Apple's Mail and Safari applications have encoding menus, and TextEdit allows the user to reopen the file with an explicitly specified encoding. If you are forced to guess the encoding (and note that in the absence of explicit information, it is a guess): 1. Try stringWithContentsOfFile:usedEncoding:error: or initWithContentsOfFile:usedEncoding:error: (or the URL-based equivalents). These methods try to determine the encoding of the resource, and if successful return by reference the encoding used. 2. If (1) fails, try to read the resource by specifying UTF-8 as the encoding. 3. If (2) fails, try an appropriate legacy encoding. "Appropriate" here depends a bit on circumstances; it might be the default C string encoding, it might be ISO or Windows Latin 1, or something else, depending on where your data are coming from. 4. Finally, you can try NSAttributedString's loading methods from the Application Kit (such as initWithURL:options:documentAttributes:error:). These methods attempt to load plain text files, and return the encoding used. They can be used on more-or-less arbitrary text documents, and are worth considering if your application has no special expertise in text. They might not be as appropriate for Foundation-level tools or documents that are not natural-language text. Reading Strings From and Writing Strings To Files and URLs Reading From Files and URLs 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 20Writing to Files and URLs Compared with reading data from a file or URL, writing isstraightforward—NSString providestwo convenient methods, writeToFile:atomically:encoding:error: and writeToURL:atomically:encoding:error:. You must specify the encoding that should be used, and choose whether to write the resource atomically or not. If you do not choose to write atomically, the string is written directly to the path you specify. If you choose to write it atomically, it is written first to an auxiliary file, and then the auxiliary file is renamed to the path. This option guarantees that the file, if it exists at all, won’t be corrupted even if the system should crash during writing. If you write to an URL, the atomicity option is ignored if the destination is not of a type that can be accessed atomically. NSURL *URL = ...; NSString *string = ...; NSError *error; BOOL ok = [string writeToURL:URL atomically:YES encoding:NSUnicodeStringEncoding error:&error]; if (!ok) { // an error occurred NSLog(@"Error writing file at %@\n%@", path, [error localizedFailureReason]); // implementation continues ... Summary This table summarizes the most common means of reading and writing string objects to and from files and URLs: Source Creation method Extraction method writeToURL: atomically:encoding: error: stringWithContentsOfURL: encoding:error: stringWithContentsOfURL: usedEncoding:error: URL contents writeToFile: atomically:encoding: error: stringWithContentsOfFile: encoding:error: stringWithContentsOfFile: usedEncoding:error: File contents Reading Strings From and Writing Strings To Files and URLs Writing to Files and URLs 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 21The string classes provide methods for finding characters and substrings within strings and for comparing one string to another. These methods conform to the Unicode standard for determining whether two character sequences are equivalent. The string classes provide comparison methods that handle composed character sequences properly, though you do have the option of specifying a literal search when efficiency is important and you can guarantee some canonical form for composed character sequences. Search and Comparison Methods The search and comparison methods each come in several variants. The simplest version of each searches or compares entire strings. Other variants allow you to alter the way comparison of composed charactersequences is performed and to specify a specific range of characters within a string to be searched or compared; you can also search and compare strings in the context of a given locale. These are the basic search and comparison methods: Search methods Comparison methods rangeOfString: compare: rangeOfString: options: compare:options: rangeOfString: options:range: compare:options: range: rangeOfString: options:range: locale: compare:options: range:locale: rangeOfCharacterFromSet: rangeOfCharacterFromSet: options: rangeOfCharacterFromSet: options:range: Searching strings You use the rangeOfString:... methods to search for a substring within the receiver. The rangeOfCharacterFromSet:... methodssearch for individual charactersfrom a supplied set of characters. 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 22 Searching, Comparing, and Sorting StringsSubstrings are found only if completely contained within the specified range. If you specify a range for a search or comparison method and don’t request NSLiteralSearch (see below), the range must not break composed character sequences on either end; if it does, you could get an incorrect result. (See the method description for rangeOfComposedCharacterSequenceAtIndex: for a code sample that adjusts a range to lie on character sequence boundaries.) You can also scan a string object for numeric and string values using an instance of NSScanner. For more about scanners, see “Scanners” (page 36). Both the NSString and the NSScanner class clusters use the NSCharacterSet class cluster forsearch operations. For more about charactersets,see “Character Sets” (page 33). If you simply want to determine whether a string contains a given pattern, you can use a predicate: BOOL match = [myPredicate evaluateWithObject:myString]; For more about predicates, see Predicate Programming Guide . Comparing and sorting strings The compare:... methods return the lexical ordering of the receiver and the supplied string. Several other methods allow you to determine whether two strings are equal or whether one isthe prefix orsuffix of another, but they don’t have variants that allow you to specify search options or ranges. The simplest method you can use to compare strings is compare:—this is the same as invoking compare:options:range: with no options and the receiver’s full extent as the range. If you want to specify comparison options(NSCaseInsensitiveSearch, NSLiteralSearch, or NSNumericSearch) you can use compare:options:; if you want to specify a locale you can use compare:options:range:locale:. NSString also provides various convenience methodsto allow you to perform common comparisons without the need to specify ranges and options directly, for example caseInsensitiveCompare: and localizedCompare:. Important: For user-visible sorted lists, you should always use localized comparisons. Thustypically instead of compare: or caseInsensitiveCompare: you should use localizedCompare: or localizedCaseInsensitiveCompare:. If you want to compare strings to order them in the same way as they’re presented in Finder, you should use compare:options:range:locale: with the user’s locale and the following options: NSCaseInsensitiveSearch, NSNumericSearch, NSWidthInsensitiveSearch, and NSForcedOrderingSearch. For an example, see “Sorting strings like Finder” (page 26). Searching, Comparing, and Sorting Strings Search and Comparison Methods 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 23Search and Comparison Options Several of the search and comparison methods take an “options” argument. This is a bit mask that adds further constraints to the operation. You create the mask by combining the following options (not all options are available for every method): Search option Effect NSCaseInsensitive- Ignores case distinctions among characters. Search Performs a byte-for-byte comparison. Differing literal sequences (such as composed character sequences) that would otherwise be considered equivalent are considered not to match. Using this option can speed some operations dramatically. NSLiteralSearch NSBackwardsSearch Performs searching from the end of the range toward the beginning. Performs searching only on characters at the beginning or end of the range. No match at the beginning or end means nothing is found, even if a matching sequence of characters occurs elsewhere in the string. NSAnchoredSearch When used with the compare:options: methods, groups of numbers are treated as a numeric value for the purpose of comparison. For example, Filename9.txt < Filename20.txt < Filename100.txt. NSNumericSearch Search and comparison are currently performed as if the NSLiteralSearch option were specified. Examples Case-Insensitive Search for Prefix and Suffix NSString provides the methods hasPrefix: and hasSuffix: that you can use to find an exact match for a prefix or suffix. The following example illustrates how you can use rangeOfString:options: with a combination of options to perform case insensitive searches. NSString *searchString = @"age"; NSString *beginsTest = @"Agencies"; NSRange prefixRange = [beginsTest rangeOfString:searchString Searching, Comparing, and Sorting Strings Search and Comparison Options 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 24options:(NSAnchoredSearch | NSCaseInsensitiveSearch)]; // prefixRange = {0, 3} NSString *endsTest = @"BRICOLAGE"; NSRange suffixRange = [endsTest rangeOfString:searchString options:(NSAnchoredSearch | NSCaseInsensitiveSearch | NSBackwardsSearch)]; // suffixRange = {6, 3} Comparing Strings The following examples illustrate the use of various string comparison methods and associated options. The first shows the simplest comparison method. NSString *string1 = @"string1"; NSString *string2 = @"string2"; NSComparisonResult result; result = [string1 compare:string2]; // result = -1 (NSOrderedAscending) You can compare strings numerically using the NSNumericSearch option: NSString *string10 = @"string10"; NSString *string2 = @"string2"; NSComparisonResult result; result = [string10 compare:string2]; // result = -1 (NSOrderedAscending) result = [string10 compare:string2 options:NSNumericSearch]; // result = 1 (NSOrderedDescending) You can use convenience methods (caseInsensitiveCompare: and localizedCaseInsensitiveCompare:) to perform case-insensitive comparisons: Searching, Comparing, and Sorting Strings Examples 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 25NSString *string_a = @"Aardvark"; NSString *string_A = @"AARDVARK"; result = [string_a compare:string_A]; // result = 1 (NSOrderedDescending) result = [string_a caseInsensitiveCompare:string_A]; // result = 0 (NSOrderedSame) // equivalent to [string_a compare:string_A options:NSCaseInsensitiveSearch] Sorting strings like Finder To sort strings the way Finder does in OS X v10.6 and later, use the localizedStandardCompare: method. It should be used whenever file names or other strings are presented in lists and tables where Finder-like sorting is appropriate. The exact behavior of this method is different under different localizations, so clients should not depend on the exact sorting order of the strings. The following example shows another implementation of similar functionality, comparing strings to order them in the same way as they’re presented in Finder, and it also shows how to sort the array of strings. First, define a sorting function that includes the relevant comparison options (for efficiency, pass the user's locale as the context—this way it's only looked up once). int finderSortWithLocale(id string1, id string2, void *locale) { static NSStringCompareOptions comparisonOptions = NSCaseInsensitiveSearch | NSNumericSearch | NSWidthInsensitiveSearch | NSForcedOrderingSearch; NSRange string1Range = NSMakeRange(0, [string1 length]); return [string1 compare:string2 options:comparisonOptions range:string1Range locale:(NSLocale *)locale]; } Searching, Comparing, and Sorting Strings Examples 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 26You pass the function as a parameter to sortedArrayUsingFunction:context: with the user’s current locale as the context: NSArray *stringsArray = @[@"string 1", @"String 21", @"string 12", @"String 11", @"String 02"]; NSArray *sortedArray = [stringsArray sortedArrayUsingFunction:finderSortWithLocale context:[NSLocale currentLocale]]; // sortedArray contains { "string 1", "String 02", "String 11", "string 12", "String 21" } Searching, Comparing, and Sorting Strings Examples 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 27This article describes how line and paragraph separators are defined and how you can separate a string by paragraph. Line and Paragraph Separator Characters There are a number of ways in which a line or paragraph break may be represented. Historically \n, \r, and \r\n have been used. Unicode defines an unambiguous paragraph separator, U+2029 (for which Cocoa provides the constant NSParagraphSeparatorCharacter), and an unambiguous line separator, U+2028 (for which Cocoa provides the constant NSLineSeparatorCharacter). In the Cocoa text system, the NSParagraphSeparatorCharacter is treated consistently as a paragraph break, and NSLineSeparatorCharacter is treated consistently as a line break that is not a paragraph break—that is, a line break within a paragraph. However, in other contexts, there are few guarantees as to how these characters will be treated. POSIX-level software, for example, often recognizes only \n as a break. Some older Macintosh software recognizes only \r, and some Windows software recognizes only \r\n. Often there is no distinction between line and paragraph breaks. Which line or paragraph break character you should use depends on how your data may be used and on what platforms. The Cocoa text system recognizes \n, \r, or \r\n all as paragraph breaks—equivalent to NSParagraphSeparatorCharacter.When it inserts paragraph breaks, for example with insertNewline:, it uses \n. Ordinarily NSLineSeparatorCharacter is used only for breaks that are specifically line breaks and not paragraph breaks, for example in insertLineBreak:, or for representing HTML
elements. If your breaks are specifically intended as line breaks and not paragraph breaks, then you should typically use NSLineSeparatorCharacter. Otherwise, you may use \n, \r, or \r\n depending on what other software is likely to process your text. The default choice for Cocoa is usually \n. Separating a String “by Paragraph” A common approach to separating a string “by paragraph” is simply to use: NSArray *arr = [myString componentsSeparatedByString:@"\n"]; 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 28 Paragraphs and Line BreaksThis, however, ignores the fact that there are a number of other ways in which a paragraph or line break may be represented in a string—\r, \r\n, or Unicode separators. Instead you can use methods—such as lineRangeForRange: or getParagraphStart:end:contentsEnd:forRange:—that take into account the variety of possible line terminations, as illustrated in the following example. NSString *string = /* assume this exists */; unsigned length = [string length]; unsigned paraStart = 0, paraEnd = 0, contentsEnd = 0; NSMutableArray *array = [NSMutableArray array]; NSRange currentRange; while (paraEnd < length) { [string getParagraphStart:¶Start end:¶End contentsEnd:&contentsEnd forRange:NSMakeRange(paraEnd, 0)]; currentRange = NSMakeRange(paraStart, contentsEnd - paraStart); [array addObject:[string substringWithRange:currentRange]]; } Paragraphs and Line Breaks Separating a String “by Paragraph” 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 29It's common to think of a string as a sequence of characters, but when working with NSString objects, or with Unicode strings in general, in most cases it is better to deal with substrings rather than with individual characters. The reason for this is that what the user perceives as a character in text may in many cases be represented by multiple characters in the string. NSString has a large inventory of methods for properly handling Unicode strings, which in general make Unicode compliance easy, but there are a few precautions you should observe. NSString objects are conceptually UTF-16 with platform endianness. That doesn't necessarily imply anything about their internalstorage mechanism; what it meansisthat NSString lengths, character indexes, and ranges are expressed in terms of UTF-16 units, and that the term “character” in NSString method names refers to 16-bit platform-endian UTF-16 units. This is a common convention for string objects. In most cases, clients don't need to be overly concerned with this; aslong as you are dealing with substrings, the precise interpretation of the range indexes is not necessarily significant. The vast majority of Unicode code points used for writing living languages are represented by single UTF-16 units. However, some less common Unicode code points are represented in UTF-16 by surrogate pairs. A surrogate pair is a sequence of two UTF-16 units, taken from specific reserved ranges, that together represent a single Unicode code point. CFString has functions for converting between surrogate pairs and the UTF-32 representation of the corresponding Unicode code point. When dealing with NSString objects, one constraint is that substring boundaries usually should not separate the two halves of a surrogate pair. This is generally automatic for rangesreturned from most Cocoa methods, but if you are constructing substring ranges yourself you should keep this in mind. However, this is not the only constraint you should consider. In many writing systems, a single character may be composed of a base letter plus an accent or other decoration. The number of possible letters and accents precludes Unicode from representing each combination as a single code point, so in general such combinations are represented by a base character followed by one or more combining marks. For compatibility reasons, Unicode does have single code points for a number of the most common combinations; these are referred to as precomposed forms, and Unicode normalization transformations can be used to convert between precomposed and decomposed representations. However, even if a string is fully precomposed, there are still many combinations that must be represented using a base character and combining marks. For most text processing, substring ranges should be arranged so that their boundaries do not separate a base character from its associated combining marks. 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 30 Characters and Grapheme ClustersIn addition, there are writing systems in which characters represent a combination of parts that are more complicated than accent marks. In Korean, for example, a single Hangul syllable can be composed of two or three subparts known as jamo. In the Indic and Indic-influenced writing systems common throughout South and Southeast Asia, single written characters often represent combinations of consonants, vowels, and marks such as viramas, and the Unicode representations of these writing systems often use code points for these individual parts,so that a single character may be composed of multiple code points. For most text processing, substring ranges should also be arranged so that their boundaries do not separate the jamo in a single Hangul syllable, or the components of an Indic consonant cluster. In general, these combinations—surrogate pairs, base characters plus combining marks, Hangul jamo, and Indic consonant clusters—are referred to as grapheme clusters. In order to take them into account, you can use NSString’s rangeOfComposedCharacterSequencesForRange: or rangeOfComposedCharacterSequenceAtIndex: methods, or CFStringGetRangeOfComposedCharactersAtIndex. These can be used to adjuststring indexes orsubstring ranges so that they fall on grapheme cluster boundaries, taking into account all of the constraints mentioned above. These methods should be the default choice for programmatically determining the boundaries of user-perceived characters.: In some cases, Unicode algorithms deal with multiple charactersin waysthat go beyond even grapheme cluster boundaries. Unicode casing algorithms may convert a single character into multiple characters when going from lowercase to uppercase; for example, the standard uppercase equivalent of the German character “ß” is the two-letter sequence “SS”. Localized collation algorithms in many languages consider multiple-character sequences as single units; for example, the sequence “ch” is treated as a single letter for sorting purposes in some European languages. In order to deal properly with cases like these, it is important to use standard NSString methods for such operations as casing, sorting, and searching, and to use them on the entire string to which they are to apply. Use NSString methods such as lowercaseString, uppercaseString, capitalizedString, compare: and its variants, rangeOfString: and its variants, and rangeOfCharacterFromSet: and its variants, or their CFString equivalents. These all take into account the complexities of Unicode string processing, and the searching and sorting methods in particular have many options to control the types of equivalences they are to recognize. In some less common cases, it may be necessary to tailor the definition of grapheme clusters to a particular need. The issues involved in determining and tailoring grapheme cluster boundaries are covered in detail in Unicode Standard Annex #29, which gives a number of examples and some algorithms. The Unicode standard in general is the best source for information about Unicode algorithms and the considerations involved in processing Unicode strings. If you are interested in grapheme cluster boundaries from the point of view of cursor movement and insertion point positioning, and you are using the Cocoa text system, you should know that on OS X v10.5 and later, NSLayoutManager has API support for determining insertion point positions within a line of text as it is laid Characters and Grapheme Clusters 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 31out. Note that insertion point boundaries are not identical to glyph boundaries; a ligature glyph in some cases, such as an “fi” ligature in Latin script, may require an internal insertion point on a user-perceived character boundary. See Cocoa Text Architecture Guide for more information. Characters and Grapheme Clusters 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 32An NSCharacterSet object represents a set of Unicode characters. NSString and NSScanner objects use NSCharacterSet objects to group characters together for searching operations, so that they can find any of a particular set of characters during a search. Character Set Basics A character set object represents a set of Unicode characters. Character sets are represented by instances of a class cluster. The cluster’s two public classes, NSCharacterSet and NSMutableCharacterSet, declare the programmatic interface for immutable and mutable character sets, respectively. An immutable character set is defined when it is created and subsequently cannot be changed. A mutable character set can be changed after it’s created. A character set object doesn’t perform any tasks; it simply holds a set of character values to limit operations on strings. The NSString and NSScanner classes define methods that take NSCharacterSet objects as argumentsto find any ofseveral characters. For example, this code excerpt findsthe range of the first uppercase letter in myString:. NSString *myString = @"some text in an NSString..."; NSCharacterSet *characterSet = [NSCharacterSet uppercaseLetterCharacterSet]; NSRange letterRange = [myString rangeOfCharacterFromSet:characterSet]; After this fragment executes, letterRange.location is equal to the index of the first “N” in “NSString” after rangeOfCharacterFromSet: isinvoked. If the first letter of the string were “S”, then letterRange.location would be 0. Creating Character Sets NSCharacterSet defines class methodsthat return commonly used charactersets,such asletters(uppercase or lowercase), decimal digits, whitespace, and so on. These “standard” character sets are always immutable, even if created by sending a message to NSMutableCharacterSet. See “Standard Character Sets and Unicode Definitions” (page 35) for more information on standard character sets. 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 33 Character SetsYou can use a standard character set as a starting point for building a custom set by making a mutable copy of it and changing that. (You can also start from scratch by creating a mutable character set with alloc and init and adding characters to it.) For example, this fragment creates a character set containing letters, digits, and basic punctuation: NSMutableCharacterSet *workingSet = [[NSCharacterSet alphanumericCharacterSet] mutableCopy]; [workingSet addCharactersInString:@";:,."]; NSCharacterSet *finalCharacterSet = [workingSet copy]; To define a custom character set using Unicode code points, use code similar to the following fragment (which creates a character set including the form feed and line separator characters): UniChar chars[] = {0x000C, 0x2028}; NSString *string = [[NSString alloc] initWithCharacters:chars length:sizeof(chars) / sizeof(UniChar)]; NSCharacterSet *characterSet = [NSCharacterSet characterSetWithCharactersInString:string]; Performance considerations Because character sets often participate in performance-critical code, you should be aware of the aspects of their use that can affect the performance of your application. Mutable character sets are generally much more expensive than immutable character sets. They consume more memory and are costly to invert (an operation often performed in scanning a string). Because of this, you should follow these guidelines: ● Create as few mutable character sets as possible. ● Cache character sets (in a global dictionary, perhaps) instead of continually recreating them. ● When creating a custom set that doesn’t need to change after creation, make an immutable copy of the final character set for actual use, and dispose of the working mutable character set. Alternatively, create a character set file as described in “Creating a character set file” (page 35) and store it in your application’s main bundle. ● Similarly, avoid archiving characterset objects;store them in characterset filesinstead. Archiving can result in a character set being duplicated in different archive files, resulting in wasted disk space and duplicates in memory for each separate archive read. Character Sets Performance considerations 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 34Creating a character set file If your application frequently uses a custom character set, you should save its definition in a resource file and load that instead of explicitly adding individual characters each time you need to create the set. You can save a character set by getting its bitmap representation (an NSData object) and saving that object to a file: NSData *charSetRep = [finalCharacterSet bitmapRepresentation]; NSURL *dataURL = <#URL for character set#>; NSError *error; BOOL result = [charSetRep writeToURL:dataURL options:NSDataWritingAtomic error:&error]; By convention, characterset filenames use the extension .bitmap. If you intend for othersto use your character set files, you should follow this convention. To read a character set file with a .bitmap extension, simply use the characterSetWithContentsOfFile: method. Standard Character Sets and Unicode Definitions The standard character sets, such as that returned by letterCharacterSet, are formally defined in terms of the normative and informative categories established by the Unicode standard, such as Uppercase Letter, Combining Mark, and so on. The formal definition of a standard character set is in most cases given as one or more of the categories defined in the standard. For example, the set returned by lowercaseLetterCharacterSet include all characters in normative category Lowercase Letters, while the set returned by letterCharacterSet includes the characters in all of the Letter categories. Note that the definitions of the categoriesthemselves may change with new versions of the Unicode standard. You can download the files that define category membership from http://www.unicode.org/. Character Sets Creating a character set file 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 35An NSScanner object scans the characters of an NSString object, typically interpreting the characters and converting them into number and string values. You assign the scanner’s string on creation, and the scanner progresses through the characters of that string from beginning to end as you request items. Creating a Scanner NSScanner is a class cluster with a single public class, NSScanner. Generally, you instantiate a scanner object by invoking the class method scannerWithString: or localizedScannerWithString:. Either method returns a scanner object initialized with the string you pass to it. The newly created scanner starts at the beginning of its string. You scan components using the scan... methods such as scanInt:, scanDouble:, and scanString:intoString:. If you are scanning multiple lines, you typically create a while loop that continues until the scanner is at the end of the string, as illustrated in the following code fragment: float aFloat; NSScanner *theScanner = [NSScanner scannerWithString:aString]; while ([theScanner isAtEnd] == NO) { [theScanner scanFloat:&aFloat]; // implementation continues... } You can configure a scanner to consider or ignore case using the setCaseSensitive: method. By default a scanner ignores case. Using a Scanner Scan operationsstart at the scan location and advance the scanner to just past the last character in the scanned value representation (if any). For example, after scanning an integer from the string “137 small cases of bananas”, a scanner’s location will be 3, indicating the space immediately after the number. Often you need to advance the scan location to skip characters in which you are not interested. You can change the implicit 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 36 Scannersscan location with the setScanLocation: method to skip ahead a certain number of characters (you can also use the method to rescan a portion of the string after an error). Typically, however, you either want to skip characters from a particular character set, scan past a specific string, or scan up to a specific string. You can configure a scanner to skip a set of characters with the setCharactersToBeSkipped: method. A scanner ignores characters to be skipped at the beginning of any scan operation. Once it finds a scannable character, however, it includes all characters matching the request. Scanners skip whitespace and newline characters by default. Note that case is always considered with regard to characters to be skipped. To skip all English vowels, for example, you must set the characters to be skipped to those in the string “AEIOUaeiou”. If you want to read content from the current location up to a particular string, you can use scanUpToString:intoString: (you can pass NULL as the second argument if you simply want to skip the intervening characters). For example, given the following string: 137 small cases of bananas you can find the type of container and number of containers using scanUpToString:intoString: asshown in the following example. NSString *bananas = @"137 small cases of bananas"; NSString *separatorString = @" of"; NSScanner *aScanner = [NSScanner scannerWithString:bananas]; NSInteger anInteger; [aScanner scanInteger:&anInteger]; NSString *container; [aScanner scanUpToString:separatorString intoString:&container]; It is important to note that the search string (separatorString) is " of". By default a scanner ignores whitespace, so the space character after the integer is ignored. Once the scanner begins to accumulate characters, however, all characters are added to the output string until the search string is reached. Thus if the search string is "of" (no space before), the first value of container is “small cases ” (includes the space following); if the search string is " of" (with a space before), the first value of container is “small cases” (no space following). Scanners Using a Scanner 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 37After scanning up to a given string, the scan location is the beginning of that string. If you want to scan past thatstring, you must therefore firstscan in the string you scanned up to. The following code fragment illustrates how to skip past the search string in the previous example and determine the type of product in the container. Note the use of substringFromIndex: to in effect scan up to the end of a string. [aScanner scanString:separatorString intoString:NULL]; NSString *product; product = [[aScanner string] substringFromIndex:[aScanner scanLocation]]; // could also use: // product = [bananas substringFromIndex:[aScanner scanLocation]]; Example Suppose you have a string containing lines such as: Product: Acme Potato Peeler; Cost: 0.98 73 Product: Chef Pierre Pasta Fork; Cost: 0.75 19 Product: Chef Pierre Colander; Cost: 1.27 2 The following example uses alternating scan operationsto extract the product names and costs(costs are read as a float forsimplicity’ssake),skipping the expected substrings“Product:” and “Cost:”, as well asthe semicolon. Note that because a scanner skips whitespace and newlines by default, the loop does no special processing for them (in particular there is no need to do additional whitespace processing to retrieve the final integer). NSString *string = @"Product: Acme Potato Peeler; Cost: 0.98 73\n\ Product: Chef Pierre Pasta Fork; Cost: 0.75 19\n\ Product: Chef Pierre Colander; Cost: 1.27 2\n"; NSCharacterSet *semicolonSet; NSScanner *theScanner; NSString *PRODUCT = @"Product:"; NSString *COST = @"Cost:"; NSString *productName; float productCost; Scanners Example 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 38NSInteger productSold; semicolonSet = [NSCharacterSet characterSetWithCharactersInString:@";"]; theScanner = [NSScanner scannerWithString:string]; while ([theScanner isAtEnd] == NO) { if ([theScanner scanString:PRODUCT intoString:NULL] && [theScanner scanUpToCharactersFromSet:semicolonSet intoString:&productName] && [theScanner scanString:@";" intoString:NULL] && [theScanner scanString:COST intoString:NULL] && [theScanner scanFloat:&productCost] && [theScanner scanInteger:&productSold]) { NSLog(@"Sales of %@: $%1.2f", productName, productCost * productSold); } } Localization A scanner bases some of its scanning behavior on a locale, which specifies a language and conventions for value representations. NSScanner uses only the locale’s definition for the decimal separator (given by the key named NSDecimalSeparator). You can create a scanner with the user’s locale by using localizedScannerWithString:, or set the locale explicitly using setLocale:. If you use a method that doesn’t specify a locale, the scanner assumes the default locale values. Scanners Localization 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 39NSString provides a rich set of methodsfor manipulating strings asfile-system paths. You can extract a path’s directory, filename, and extension, expand a tilde expression (such as “~me”) or create one for the user’s home directory, and clean up paths containing symbolic links, redundant slashes, and references to “.” (current directory) and “..” (parent directory). Note: Where possible, you should use instances of NSURL to represent paths—the operating system deals with URLs more efficiently than with string representations of paths. Representing a Path NSString represents paths generically with ‘/’ asthe path separator and ‘.’ asthe extension separator. Methods that accept strings as path arguments convert these generic representations to the proper system-specific form as needed. On systems with an implicit root directory, absolute paths begin with a path separator or with a tilde expression (“~/...” or “~user/...”). Where a device must be specified, you can do that yourself—introducing a system dependency—or allow the string object to add a default device. You can create a standardized representation of a path using stringByStandardizingPath. This performs a number of tasks including: ● Expansion of an initial tilde expression; ● Reduction of empty components and references to the current directory (“//” and “/./”) to single path separators; ● In absolute paths, resolution of references to the parent directory (“..”) to the real parent directory; for example: NSString *path = @"/usr/bin/./grep"; NSString *standardizedPath = [path stringByStandardizingPath]; // standardizedPath: /usr/bin/grep path = @"~me"; 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 40 String Representations of File PathsstandardizedPath = [path stringByStandardizingPath]; // standardizedPath (assuming conventional naming scheme): /Users/Me path = @"/usr/include/objc/.."; standardizedPath = [path stringByStandardizingPath]; // standardizedPath: /usr/include path = @"/private/usr/include"; standardizedPath = [path stringByStandardizingPath]; // standardizedPath: /usr/include User Directories The following examples illustrate how you can use NSString’s path utilities and other Cocoa functions to get the user directories. // Assuming that users’ home directories are stored in /Users NSString *meHome = [@"~me" stringByExpandingTildeInPath]; // meHome = @"/Users/me" NSString *mePublic = [@"~me/Public" stringByExpandingTildeInPath]; // mePublic = @"/Users/me/Public" You can find the home directory for the current user and for a given user with NSHomeDirectory and NSHomeDirectoryForUser respectively: NSString *currentUserHomeDirectory = NSHomeDirectory(); NSString *meHomeDirectory = NSHomeDirectoryForUser(@"me"); Note that you should typically use the function NSSearchPathForDirectoriesInDomains to locate standard directories for the current user. For example, instead of: NSString *documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; String Representations of File Paths User Directories 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 41you should use: NSString *documentsDirectory; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); if ([paths count] > 0) { documentsDirectory = [paths objectAtIndex:0]; } Path Components NSString provides a rich set of methods for manipulating strings as file-system paths, for example: Interprets the receiver as a path and returns the receiver’s extension, if any. pathExtension Returns a new string made by deleting the extension (if any, and only the last) from the receiver. stringByDeletingPathExtension Returns a new string made by deleting the last path component from the receiver, along with any final path separator. stringByDeletingLastPathComponent Using these and related methods described in NSString Class Reference , you can extract a path’s directory, filename, and extension, as illustrated by the following examples. NSString *documentPath = @"~me/Public/Demo/readme.txt"; NSString *documentDirectory = [documentPath stringByDeletingLastPathComponent]; // documentDirectory = @"~me/Public/Demo" NSString *documentFilename = [documentPath lastPathComponent]; // documentFilename = @"readme.txt" NSString *documentExtension = [documentPath pathExtension]; // documentExtension = @"txt" String Representations of File Paths Path Components 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 42File Name Completion You can find possible expansions of file names using completePathIntoString:caseSensitive:matchesIntoArray:filterTypes:. For example, given a directory ~/Demo that contains the following files: ReadMe.txt readme.html readme.rtf recondite.txt test.txt you can find all possible completions for the path ~/Demo/r as follows: NSString *partialPath = @"~/Demo/r"; NSString *longestCompletion; NSArray *outputArray; unsigned allMatches = [partialPath completePathIntoString:&longestCompletion caseSensitive:NO matchesIntoArray:&outputArray filterTypes:NULL]; // allMatches = 3 // longestCompletion = @"~/Demo/re" // outputArray = (@"~/Demo/readme.html", "~/Demo/readme.rtf", "~/Demo/recondite.txt") You can find possible completions for the path ~/Demo/r that have an extension “.txt” or “.rtf” as follows: NSArray *filterTypes = @[@"txt", @"rtf"]; unsigned textMatches = [partialPath completePathIntoString:&outputName caseSensitive:NO matchesIntoArray:&outputArray filterTypes:filterTypes]; // allMatches = 2 // longestCompletion = @"~/Demo/re" // outputArray = (@"~/Demo/readme.rtf", @"~/Demo/recondite.txt") String Representations of File Paths File Name Completion 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 43You can draw string objects directly in a focused NSView using methods such as drawAtPoint:withAttributes: (to draw a string with multiple attributes, such as multiple text fonts, you must use an NSAttributedString object). These methods are described briefly in “Text” in Cocoa Drawing Guide . The simple methods, however, are designed for drawing small amounts of text or text that is only drawn rarely—they create and dispose of various supporting objects every time you call them. To draw strings repeatedly, it is more efficient to use NSLayoutManager, as described in “Drawing Strings”. For an overview of the Cocoa text system, of which NSLayoutManager is a part, see Cocoa Text Architecture Guide . 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 44 Drawing StringsThis table describes the changes to String Programming Guide . Date Notes 2012-07-17 Updated code snippets to adopt new Objective-C features. Corrected string constant character set to UTF-8. Added guidance about using localizedStandardCompare: for Finder-like sorting. Added caveat to avoid using %s with RTL languages. Revised "String Format Specifiers" article. 2012-06-11 2009-10-15 Added links to Cocoa Core Competencies. Added new aricle on character clusters; updated list of string format specifiers. 2008-10-15 2007-10-18 Corrected minor typographical errors. Added notes regarding NSInteger and NSUInteger to "String Format Specifiers". 2007-07-10 2007-03-06 Corrected minor typographical errors. 2007-02-08 Corrected sentence fragments and improved the example in "Scanners." 2006-12-05 Added code samples to illustrate searching and path manipulation. 2006-11-07 Made minor revisions to "Scanners" article. 2006-10-03 Added links to path manipulation methods. 2006-06-28 Corrected typographical errors. Added a new article, "Reading Strings From and Writing Strings To Files and URLs"; significantly updated "Creating and Converting Strings." 2006-05-23 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 45 Document Revision HistoryDate Notes Included “Creating a Character Set” into “Character Sets” (page 33). Changed title from "Strings" to conform to reference consistency guidelines. 2006-01-10 Added “Formatting String Objects” (page 13) article. Added Data Formatting and the Core Foundation Strings programming topics to the introduction. 2004-06-28 Added information about custom Unicode character sets and retrieved missing code fragments in “Creating a Character Set”. Added information and cross-reference to “Drawing Strings” (page 44). Rewrote introduction and added an index. 2004-02-06 Added NSNumericSearch description to “Searching, Comparing, and Sorting Strings” (page 22). 2003-09-09 2003-03-17 Reinstated the sample code that was missing from “Scanners” (page 36). Updated “Creating and Converting String Objects” (page 8) to recommend the use of UTF8 encoding, and noted the pending deprecation of the cString... methods. 2003-01-17 2002-11-12 Revision history was added to existing topic. Document Revision History 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 46A alloc method 34 archiving character set objects 34 ASCII character encoding converting string object contents 8 availableStringEncodings method 8 C C strings Cocoa string objects and 7 creating and converting 11 character encodings string manipulation and 8 character sets custom 34 example code 34 guidelines for use 34 mutable and immutable 33 saving to a file 35 standard 33, 35 characterAtIndex: method 7 characterSetWithContentsOfFile: method 35 compare: method 22 compare:options: method 22, 24 compare:options:range: method 22 comparing strings 22–23 comparison methods for strings 22 componentsSeparatedByString: method 11 current directories resolving references to 40 D dataUsingEncoding: method 11, 12 defaultCStringEncoding method 8 description method 13 descriptionWithLocale: method 13 directories manipulating strings as paths 40, 42 E encodings, character string manipulation and 8 EUC character encoding 8 F file-system paths and strings 42 format strings 13 G getCharacters:length: method 12 I init method for mutable character sets 34 initWithData:encoding: method 8, 11, 12 initWithFormat: method 10 initWithFormat:locale: method 12 ISO Latin 1 character encoding 8 L length method 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 47 Indexfor string objects 7 letterCharacterSet method 35 localization scanning strings and 39 value formatting and 13 localizedScannerWithString: method 36, 39 localizedStringWithFormat: method 9, 12 lowercaseLetterCharacterSet method 35 M myString: method 33 N NSCharacterSet class 33 NSLayoutManager class 44 NSMutableCharacterSet class 33 NSMutableString class 7, 8 NSScanner class 23, 36–38 NSString class creating string objects from 8 described 7 methods for representing file-system paths 40 scanners and 36 NSView class 44 P parent directories resolving references to 40 paths and strings 42 primitive methods of NSString 7 printf function NSString and 13 R rangeOfCharacterFromSet: method 22, 33 rangeOfCharacterFromSet:options: method 22 rangeOfCharacterFromSet:options:range: method 22 rangeOfComposedCharacterSequenceAtIndex: method 23 rangeOfString: method 22 rangeOfString:options: method 22 rangeOfString:options:range: method 22 S scan... methods 36 scanners 36, 38 instantiating 36 operation of 36 sample code 38 scannerWithString: method 36 scanUpToString:intoString: method 37 search methods for strings 22 setCaseSensitive: method 36 setCharactersToBeSkipped: method 37 setLocale: method 39 setScanLocation: method 37 Shift-JIS character encoding 8 standard character sets 33, 35 string objects combining and extracting 10 comparison methods 22 creating and converting 8–12 described 7 drawing 44 searching and comparing 22–23 stringByAppendingFormat: method 10, 12 stringByAppendingString: method 10, 12 stringWithCharacters:length: method 12 stringWithContentsOfFile: method 21 stringWithFormat: method 10 stringWithUTF8String: method 12 substringFromIndex: method 11 substringToIndex: method 11 Index 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 48substringWithRange: method 11 U Unicode characters in string objects 8 code points used to define character sets 34 in string objects 7 NSCharacterSet and 33 standard character sets 35 string comparison standard 22 UTF8 character encoding 11 UTF8String method 11, 12 V value formatting string conversion and 13 W writeToFile:atomically: method 21 Index 2012-07-17 | © 1997, 2012 Apple Inc. All Rights Reserved. 49Apple Inc. © 1997, 2012 Apple Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrievalsystem, or transmitted, in any form or by any means, mechanical, electronic, photocopying, recording, or otherwise, without prior written permission of Apple Inc., with the following exceptions: Any person is hereby authorized to store documentation on a single computer for personal use only and to print copies of documentation for personal use provided that the documentation contains Apple’s copyright notice. No licenses, express or implied, are granted with respect to any of the technology described in this document. Apple retains all intellectual property rights associated with the technology described in this document. This document is intended to assist application developers to develop applications only for Apple-labeled computers. Apple Inc. 1 Infinite Loop Cupertino, CA 95014 408-996-1010 Apple, the Apple logo, Cocoa, Finder, Mac, Macintosh, Objective-C, OS X, and Safari are trademarks of Apple Inc., registered in the U.S. and other countries. Even though Apple has reviewed this document, APPLE MAKES NO WARRANTY OR REPRESENTATION, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THIS DOCUMENT, ITS QUALITY, ACCURACY, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.ASARESULT, THISDOCUMENT IS PROVIDED “AS IS,” AND YOU, THE READER, ARE ASSUMING THE ENTIRE RISK AS TO ITS QUALITY AND ACCURACY. IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL,OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT OR INACCURACY IN THIS DOCUMENT, even if advised of the possibility of such damages. THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORAL OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer, agent, or employee is authorized to make any modification, extension, or addition to this warranty. Some states do not allow the exclusion or limitation of implied warranties or liability for incidental or consequential damages, so the above limitation or exclusion may not apply to you. This warranty gives you specific legal rights, and you may also have other rights which vary from state to state. Apple AirPort Networks2 1 Contents Chapter 1 3 Getting Started 5 Configuring an Apple Wireless Device for Internet Access Using AirPort Utility 6 Extending the Range of Your AirPort Network 6 Sharing a USB Hard Disk Connected to an AirPort Extreme Base Station or Time Capsule 6 Printing with an Apple Wireless Device 6 Sharing Your Computer’s Internet Connection Chapter 2 9 AirPort Security 9 Security for AirPort Networks at Home 10 Security for AirPort Networks in Businesses and Classrooms 11 Wi-Fi Protected Access (WPA) and WPA2 Chapter 3 14 AirPort Network Designs 15 Using AirPort Utility 17 Setting Up the AirPort Extreme Network 24 Configuring and Sharing Internet Access 41 Setting Advanced Options 43 Extending the Range of an 802.11n Network 45 Keeping Your Network Secure 49 Directing Network Traffic to a Specific Computer on Your Network (Port Mapping) 51 Logging 52 Using Back to My Mac on your Wireless Network 53 Setting up IPv6 54 Sharing and Securing USB Hard Disks on Your Network 55 Using a Time Capsule in Your Network 55 Connecting a USB Printer to an Apple Wireless Device 56 Adding a Wireless Client to Your 802.11n Network 57 Solving Problems Chapter 4 59 Behind the Scenes 59 Basic Networking 63 Items That Can Cause Interference with AirPort Glossary 641 3 1 Getting Started AirPort offers the easiest way to provide wireless Internet access and networking anywhere in the home, classroom, or office. AirPort is based on the latest Institute of Electrical and Electronics Engineers (IEEE) 802.11n draft specification and provides fast and reliable wireless networking in the home, classroom, or small office. You can enjoy data transfer rates of up to five times faster than data rates provided by the 802.11g standard and more than twice the network range. The new AirPort Extreme Base Station and the new Time Capsule are based on simultaneous dual-band technology, so they work in both the 2.4 gigahertz (GHz) or 5 GHz spectrum at the same time. And they are 100 percent backward-compatible, so Mac computers and PCs that use 802.11a, 802.11b, 802.11g, or IEEE draft specification 802.11n wireless cards can connect to an AirPort wireless network. They also work flawlessly with the AirPort Express for wireless music streaming and more. The AirPort Extreme Base Station and Time Capsule have three additional 10/100/1000BaseT Gigabit Ethernet ports, so you don’t need to include another router in your network. To set up an AirPort Extreme Base Station, an AirPort Express, or a Time Capsule, you use AirPort Utility, the easy-to-use setup and management application. AirPort Utility has a simple user experience, with all software controls accessible from the same application. It provides better management of several Apple wireless devices, with client-monitoring features and logging. If you’re using AirPort Utility version 5.4 or later, you can set up a guest network, in both the 2.4 GHz and 5 GHz bands, so that guests can connect to the Internet using your AirPort network, while you keep your private network secure. You can also choose to set up guest accounts that expire, to grant temporary access to your network; you no longer need to give your network password to visitors in your home or office. You can even set up accounts with time constraints for the best in parental controls. AirPort Utility supports IPv6 and Bonjour, so you can “advertise” network services such as printing and sharing a hard disk over the Wide Area Network (WAN) port.4 Chapter 1 Getting Started Note: When the features discussed in this document apply to the AirPort Extreme Base Station, AirPort Express, and Time Capsule, the devices are referred to collectively as Apple wireless devices. With an AirPort Extreme Base Station or a Time Capsule, you can connect a USB hard disk so that everyone on the network can back up, store, and share files. Every Time Capsule includes an internal AirPort disk, so you don’t need to connect an external one. If you want, you can connect additional USB disks to the USB port on your Time Capsule. You can also connect a USB printer to the USB port on any Apple wireless device, so that everyone on the network can access the printer or hub. All Apple wireless devices provide strong, wireless security. They offer a built-in firewall and support industry-standard encryption technologies. Yet the simple setup utility and powerful access controls make it easy for authorized users to connect to the AirPort network they create. You can use an Apple wireless device to provide wireless Internet access and share a single Internet connection among several computers in the following ways:  Set up the device to act as a router and provide Internet Protocol (IP) addresses to computers on the network using Dynamic Host Configuration Protocol (DHCP) and Network Address Translation (NAT). When the wireless device is connected to a DSL or cable modem that is connected to the Internet, it receives webpages and email content from the Internet through its Internet connection, and then sends the content to wireless-enabled computers, using the wireless network or using Ethernet if there are computers connected to the Ethernet ports.  Set up the Apple wireless device to act as a bridge on an existing network that already has Internet access and a router providing IP addresses. The device passes IP addresses and the Internet connection to AirPort or wireless-enabled computers, or computers connected to the wireless device by Ethernet. This document provides information about the latest AirPort Extreme Base Station, AirPort Express, and Time Capsule, and detailed information about designing 802.11n networks with AirPort Utility for computers using Mac OS X v10.5 or later, and Windows Vista or Windows XP with Service Pack 2. If you’re using previous versions of Mac OS X, or are setting up earlier versions of AirPort devices, you’ll find more information at www.apple.com/support/airport.Chapter 1 Getting Started 5 You can set up an Apple wireless device and connect to the Internet wirelessly in minutes. But because Apple wireless devices are flexible and powerful networking products, you can also create an AirPort network that does much more. If you want to design an AirPort network that provides Internet access to non-AirPort computers via Ethernet, or take advantage of some of your wireless device’s more advanced features, use this document to design and implement your network. You can find more general wireless networking information and an overview of AirPort technology in the earlier AirPort documents, located at www.apple.com/support/manuals/airport. Note: The images of AirPort Utility in this document are from Mac OS X v10.5. If you’re using a Windows computer, the images you see in this document may be slightly different from what you see on your screen. Configuring an Apple Wireless Device for Internet Access Using AirPort Utility Like your computer, Apple wireless devices must be set up with the appropriate hardware and IP networking information to connect to the Internet. Install AirPort Utility, which came on the CD with your wireless device, and use it to provide Internet configuration information and other network settings. AirPort Utility combines the ease of use of AirPort Setup Assistant and the power of AirPort Admin Utility. It is installed in the Utilities folder in the Applications folder on a Macintosh computer using Mac OS X, and in Start > All Programs > AirPort on computers using Windows. AirPort Utility walks you through the setup process by asking a series of questions to determine how the device’s Internet connection and other interfaces should be set up. Enter the settings you received from your ISP or network administrator for Ethernet, PPP over Ethernet (PPPoE), or your local area network (LAN); give your AirPort network a name and password; set up a device as a wireless bridge to extend the range of your existing AirPort network; and set other options. When you’ve finished entering the settings, AirPort Utility transfers the settings to your wireless device. Then it connects to the Internet and shares its Internet connection with computers that join its AirPort network. You can also create an AirPort network that takes advantage of the more advanced networking features of Apple wireless devices. To set more advanced AirPort options, use AirPort Utility to manually set up your wireless device’s configuration, or make quick adjustments to one you’ve already set up. Some of the AirPort advanced networking features can be configured only using the manual setup features in AirPort Utility. 6 Chapter 1 Getting Started Set up your Apple wireless device manually using AirPort Utility when:  You want to provide Internet access to computers that connect to the wireless device using Ethernet  you’ve already set up your device, but you need to change one setting, such as your account information  You need to configure advanced settings such as channel frequency, advanced security options, closed networks, DHCP lease time, access control, WAN privacy, power controls, or port mapping or other options For instructions on using AirPort Utility to manually set up your wireless device and network, see “Using AirPort Utility” on page 15. Extending the Range of Your AirPort Network You can extend the range of your network by using AirPort Utility to set up wireless connections among several devices in your network, or to connect a device using Ethernet to create a roaming network. For more information on extending the range of your network, see “Connecting Additional Wireless Devices to Your AirPort Network” on page 41. Sharing a USB Hard Disk Connected to an AirPort Extreme Base Station or Time Capsule If you’re using an AirPort Extreme Base Station or a Time Capsule, you can connect a USB hard disk to it, and computers connected to the network—wired or wireless, Mac or Windows—can share files using the hard disk. Every Time Capsule includes an internal AirPort disk, so you don’t need to connect an external one. If you want, you can connect additional USB disks to the USB port on your Time Capsule. See “Sharing and Securing USB Hard Disks on Your Network” on page 54. Printing with an Apple Wireless Device If you have a compatible USB printer connected to your Apple wireless device, computers on the AirPort network can use Bonjour (Apple’s zero-configuration networking technology) to print to the printer. For instructions about printing to a USB printer from a computer, see “Connecting a USB Printer to an Apple Wireless Device” on page 55. Sharing Your Computer’s Internet Connection If your computer is connected to the Internet, you can share your Internet connection with other computers using Mac OS X version 10.2 or later, or Windows XP with Service Pack 2. This is sometimes called using your computer as a software base station.Chapter 1 Getting Started 7 You can share your Internet connection as long as your computer is connected to the Internet. If your computer goes to sleep or is restarted, or if you lose your Internet connection, you need to restart Internet sharing. To start Internet sharing on a computer using Mac OS X v10.5 or later: 1 Open System Preferences and click Sharing. 2 Choose the port you want to use to share your Internet connection from the “Share your connection using” pop-up menu. 3 Select the port you want to use to share your Internet connection in the “To computers using” list. You can choose to share your Internet connection with AirPort-enabled computers or computers with built-in Ethernet, for example. 4 Select Internet Sharing in the Services list. 5 If you want to share your Internet connection with computers using AirPort, click AirPort Options to give your network a name and password. 8 Chapter 1 Getting Started To start Internet sharing on a computer using Windows: 1 Open Control Panel from the Start menu, and then click “Network and Internet.” 2 Click “Network and Sharing Center.” 3 Click “Manage network connections” in the Tasks list. 4 Right-click the network connection you want to share, and then select Properties. 5 Click Sharing and then select “Allow other network users to connect through this computer’s Internet connection.” Note: If your Internet connection and your local network use the same port (built-in Ethernet, for example), contact your ISP before you turn on Internet sharing. In some cases (if you use a cable modem, for example) you might unintentionally affect the network settings of other ISP customers, and your ISP might terminate your service to prevent you from disrupting its network. The following chapters explain AirPort security options, AirPort network design and setup, and other advanced options.2 9 2 AirPort Security This chapter provides an overview of the security features available in AirPort. Apple has designed its wireless devices to provide several levels of security, so you can enjoy peace of mind when you access the Internet, manage online financial transactions, or send and receive email. The AirPort Extreme Base Station and Time Capsule also include a slot for inserting a lock to deter theft. For information and instructions for setting up these security features, see “Setting Up the AirPort Extreme Network” on page 17. Security for AirPort Networks at Home Apple gives you ways to protect your wireless AirPort network as well as the data that travels over it. NAT Firewall You can isolate your wireless network with firewall protection. Apple wireless devices have a built-in Network Address Translation (NAT) firewall that creates a barrier between your network and the Internet, protecting data from Internet-based IP attacks. The firewall is automatically turned on when you set up the device to share a single Internet connection. For computers with a cable or DSL modem, AirPort can actually be safer than a wired connection. Closed Network Creating a closed network keeps the network name and the very existence of your network private. Prospective users of your network must know the network name and password to access it. Use AirPort Utility, located in the Utilities folder in the Applications folder on a Macintosh computer using Mac OS X, or in Start > All Programs > AirPort on a computer using Windows, to create a closed network.10 Chapter 2 AirPort Security Password Protection and Encryption AirPort uses password protection and encryption to deliver a level of security comparable to that of traditional wired networks. Users can be required to enter a password to log in to the AirPort network. When transmitting data and passwords, the wireless device uses up to 128-bit encryption, through either Wi-Fi Protected Access (WPA), WPA2, or Wired Equivalent Privacy (WEP), to scramble data and help keep it safe. If you’re setting up an 802.11n-based AirPort device, you can also use WEP (Transitional Security Network) if both WEP-compatible and WPA/WPA2-compatible computers will join your network. Note: WPA security is available only to AirPort Extreme wireless devices; AirPort and AirPort Extreme clients using Mac OS X 10.3 or later and AirPort 3.3 or later; and to non-Apple clients using other 802.11 wireless adapters that support WPA. WPA2 security requires firmware version 5.6 or later for an AirPort Extreme Base Station, firmware version 6.2 or later for an AirPort Express, firmware version 7.3 or later for a Time Capsule, and a Macintosh computer with an AirPort Extreme wireless card using AirPort 4.2 or later. If your computer uses Windows XP or Windows Vista, check the documentation that came with your computer to see if your computer supports WPA2. Security for AirPort Networks in Businesses and Classrooms Businesses and schools need to restrict network communications to authorized users and keep data safe from prying eyes. To meet this need, Apple wireless devices and software provide a robust suite of security mechanisms. Use AirPort Utility to set up these advanced security features. Transmitter Power Control Because radio waves travel in all directions, they can extend outside the confines of a specific building. The Transmit Power setting in AirPort Utility lets you adjust the transmission range of your device’s network. Only users within the network vicinity have access to the network. MAC Address Access Control Every AirPort and wireless card have a unique Media Access Control (MAC) address. For AirPort Cards and AirPort Extreme Cards, the MAC address is sometimes referred to as the AirPort ID. Support for MAC address access control lets administrators set up a list of MAC addresses and restrict access to the network to only those users whose MAC addresses are in the access control list.Chapter 2 AirPort Security 11 RADIUS Support The Remote Authentication Dial-In User Service (RADIUS) makes securing a large network easy. RADIUS is an access control protocol that allows a system administrator to create a central list of the user names and passwords of computers that can access the network. Placing this list on a centralized server allows many wireless devices to access the list and makes it easy to update. If the MAC address of a user’s computer (which is unique to each 802.11 wireless card) is not on your approved MAC address list, the user cannot join your network. Wi-Fi Protected Access (WPA) and WPA2 There has been increasing concern about the vulnerabilities of WEP. In response, the Wi-Fi Alliance, in conjunction with the IEEE, has developed enhanced, interoperable security standards called Wi-Fi Protected Access (WPA) and WPA2. WPA and WPA2 use specifications that bring together standards-based, interoperable security mechanisms that significantly increase the level of data protection and access control for wireless LANs. WPA and WPA2 provide wireless LAN users with a high-level assurance that their data remains protected and that only authorized network users can access the network. A wireless network that uses WPA or WPA2 requires all computers that access the wireless network to have WPA or WPA2 support. WPA provides a high level of data protection and (when used in Enterprise mode) requires user authentication. The main standards-based technologies that constitute WPA include Temporal Key Integrity Protocol (TKIP), 802.1X, Message Integrity Check (MIC), and Extensible Authentication Protocol (EAP). TKIP provides enhanced data encryption by addressing the WEP encryption vulnerabilities, including the frequency with which keys are used to encrypt the wireless connection. 802.1X and EAP provide the ability to authenticate a user on the wireless network. 802.1X is a port-based network access control method for wired as well as wireless networks. The IEEE adopted 802.1X as a standard in August 2001. The Message Integrity Check (MIC) is designed to prevent an attacker from capturing data packets, altering them, and resending them. The MIC provides a strong mathematical function in which the receiver and the transmitter each compute and then compare the MIC. If they do not match, the data is assumed to have been tampered with and the packet is dropped. If multiple MIC failures occur, the network may initiate countermeasures.12 Chapter 2 AirPort Security The EAP protocol known as TLS (Transport Layer Security) presents a user’s information in the form of digital certificates. A user’s digital certificates can comprise user names and passwords, smart cards, secure IDs, or any other identity credentials that the IT administrator is comfortable using. WPA uses a wide variety of standards-based EAP implementations, including EAP-Transport Layer Security (EAP-TLS), EAP-Tunnel Transport Layer Security (EAP-TTLS), and Protected Extensible Authentication Protocol (PEAP). AirPort Extreme also supports the Lightweight Extensible Authentication Protocol (LEAP), a security protocol used by Cisco access points to dynamically assign a different WEP key to each user. AirPort Extreme is compatible with Cisco’s LEAP security protocol, enabling AirPort users to join Cisco-hosted wireless networks using LEAP. In addition to TKIP, WPA2 supports the AES-CCMP encryption protocol. Based on the very secure AES national standard cipher, combined with sophisticated cryptographic techniques, AES-CCMP was specifically designed for wireless networks. Migrating from WEP to WPA2 requires new firmware for the AirPort Extreme Base Station (version 5.6 or later), and for AirPort Express (version 6.2 or later). Devices using WPA2 mode are not backward compatible with WEP. WPA and WPA2 have two modes:  Personal mode, which relies on the capabilities of TKIP or AES-CCMP without requiring an authentication server  Enterprise mode, which uses a separate server, such as a RADIUS server, for user authentication WPA and WPA2 Personal  For home or Small Office/Home Office (SOHO) networks, WPA and WPA2 operates in Personal mode, taking into account that the typical household or small office does not have an authentication server. Instead of authenticating with a RADIUS server, users manually enter a password to log in to the wireless network. When a user enters the password correctly, the wireless device starts the encryption process using TKIP or AES-CCMP. TKIP or AES-CCMP takes the original password and derives encryption keys mathematically from the network password. The encryption key is regularly changed and rotated so that the same encryption key is never used twice. Other than entering the network password, the user isn’t required to do anything to make WPA or WPA2 Personal work in the home.Chapter 2 AirPort Security 13 WPA and WPA2 Enterprise WPA is a subset of the draft IEEE 802.11i standard and effectively addresses the wireless local area network (WLAN) security requirements for the enterprise. WPA2 is a full implementation of the ratified IEEE 802.11i standard. In an enterprise with IT resources, WPA should be used in conjunction with an authentication server such as RADIUS to provide centralized access control and management. With this implementation in place, the need for add-on solutions such as virtual private networks (VPNs) may be eliminated, at least for securing wireless connections in a network. For more information about setting up a WPA or WPA2 protected network, see “Using Wi-Fi Protected Access” on page 45.3 14 3 AirPort Network Designs This chapter provides overview information and instructions for the types of AirPort Extreme networks you can set up, and some of the advanced options of AirPort Extreme. Use this chapter to design and set up your AirPort Extreme network. Configuring your Apple wireless device to implement a network design requires three steps: Step 1: Setting Up the AirPort Extreme Network Computers communicate with the wireless device over the AirPort wireless network. When you set up the AirPort network created by the wireless device, you can name the wireless network, assign a password that will be needed to join the wireless network, and set other options. Step 2: Configuring and Sharing Internet Access When computers access the Internet through the AirPort Extreme network, the wireless device connects to the Internet and transmits information to the computers over the AirPort Extreme network. You provide the wireless device with settings appropriate for your ISP and configure how the device shares this connection with other computers. Step 3: Setting Advanced Options These settings are optional for most users. They include using the Apple wireless device as a bridge between your AirPort Extreme network and an Ethernet network, setting advanced security options, extending the AirPort network to other wireless devices, and fine-tuning other settings. For specific instructions on all these steps, refer to the sections later in this chapter. You can do most of your setup and configuration tasks using AirPort Utility, and following the onscreen instructions to enter your ISP and network information. To set advanced options, you need to use AirPort Utility to manually set up your Apple wireless device and AirPort network.Chapter 3 AirPort Network Designs 15 Using AirPort Utility To set up and configure your computer or Apple wireless device to use AirPort Extreme for basic wireless networking and Internet access, use AirPort Utility and answer a series of questions about your Internet settings and how you would like to set up your network. 1 Open AirPort Utility, located in the Utilities folder in the Applications folder on a Mac, or in Start > All Programs > AirPort on a Windows computer. 2 Select your device in the list on the left if there is more than one device in your network. Click Continue, and then follow the onscreen instructions to enter the settings from your ISP or network administrator for the type of network you want to set up. See the network diagrams later in this chapter for the types of networks you can set up using AirPort Utility. To set up a more complicated network, or to make adjustments to a network you’ve already set up, use the manual setup features in AirPort Utility. Setting AirPort preferences Use AirPort preferences to set up your wireless device to alert you when there are updates available for your device. You can also set it up to notify you if there are problems detected, and to provide instructions to help solve the problems. To set AirPort preferences: 1 Open AirPort Utility, located in the Utilities folder inside the Applications folder on a Mac, and in Start > All Programs > AirPort on a Windows computer. 2 Do one of the following:  On a Mac, choose AirPort Utility > Preferences  On a Windows computer, choose File > Preferences16 Chapter 3 AirPort Network Designs Select from the following checkboxes:  Select “Check for Updates when opening AirPort Utility” to automatically check the Apple website for software and firmware updates each time you open AirPort Utility.  Select the “Check for updates” checkbox, and then choose a time interval from the pop-up menu, such as weekly, to check for software and firmware updates in the background. AirPort Utility opens if updates are available.  Select “Monitor Apple wireless devices for problems” to investigate problems that may cause the device’s status light to blink amber. With the checkbox selected, AirPort Utility opens if a problem is detected, and then provides instructions to help resolve the problem. This option monitors all of the wireless devices on the network.  Select “Only Apple wireless devices that I have configured” to monitor only the devices you’ve set up using this computer. Monitoring devices for problems requires an AirPort wireless device that supports firmware version 7.0 or later. To set up your wireless device manually: 1 Open AirPort Utility, located in the Utilities folder in the Applications folder on a Mac, or in Start > All Programs > AirPort on a Windows computer. 2 Select your device in the list. 3 Choose Base Station > Manual Setup and enter the password if necessary. The default device password is public. If you don’t see your wireless device in the list: 1 Open the AirPort status menu in the menu bar on a Mac and make sure that you’ve joined the AirPort network created by your wireless device. On a Windows computer, hover the cursor over the wireless network icon in the status tray to make sure the computer is connected to the correct network. The default network name for an Apple wireless device is AirPort Network XXXXXX, where XXXXXX is replaced with the last six digits of the AirPort ID, (or MAC address). The AirPort ID is printed on the bottom of Apple wireless devices. 2 Make sure your computer’s network and TCP/IP settings are configured properly. On a computer using Mac OS X, choose AirPort from the Show pop-up menu in the Network pane of System Preferences. Then choose Using DHCP from the Configure IPv4 pop-up menu in the TCP/IP pane. On a computer using Windows, right-click the wireless connection icon that displays the AirPort network, and choose Status. Click Properties, select Internet Protocol (TCP/IP), and then click Properties. Make sure “Obtain an IP address automatically” is selected.Chapter 3 AirPort Network Designs 17 If you can’t open the wireless device settings: 1 Make sure your network and TCP/IP settings are configured properly. On a computer using Mac OS X, select AirPort from the network connection services list in the Network pane of System Preferences. Click Advanced, and then choose Using DHCP from the Configure IPv4 pop-up menu in the TCP/IP pane. On a computer using Windows, right-click the wireless connection icon that displays the AirPort network, and choose Status. Click Properties, select Internet Protocol (TCP/IP), and then click Properties. Make sure “Obtain an IP address automatically” is selected. 2 Make sure you entered the wireless device password correctly. The default password is public. If you’ve forgotten the device password, you can reset it to public by resetting the device. To temporarily reset the device password to public, hold down the reset button for one second. To reset the device back to its default settings, hold the reset button for five full seconds. If you’re on an Ethernet network that has other devices, or you’re using Ethernet to connect to the device: AirPort Utility scans the Ethernet network to create the list of devices. As a result, when you open AirPort Utility, you may see devices that you cannot configure. Setting Up the AirPort Extreme Network The first step in configuring your Apple wireless device is setting up the device and the network it will create. You can set up most features using AirPort Utility and following the onscreen instructions to enter the information from your ISP or network administrator. To configure a network manually or set advanced options, open your wireless device’s configuration in AirPort Utility and manually set up your device and network. 1 Choose the network of the wireless device you want to configure from the AirPort status menu on a computer using Mac OS X, or from the wireless connection icon in the status tray on a computer using Windows. 2 Open AirPort Utility and select the wireless device from the list. If you don’t see the device you want to configure, click Rescan to scan for available wireless devices, and then select the one you want from the list. 18 Chapter 3 AirPort Network Designs 3 Choose Base Station > Manual Setup and enter the password if necessary. The default device password is public. You can also double-click the name of the wireless device to open its configuration in a separate window. When you open the manual setup window, the Summary pane is displayed. The summary pane provides information and status about your wireless device and network.Chapter 3 AirPort Network Designs 19 If the wireless device reports a problem, the status icon turns yellow. Click Base Station Status to display the problem and suggestions to resolve it. Wireless Device Settings Click the AirPort button, and then click Base Station or Time Capsule, depending on the device you’re setting up, to enter information about the wireless device. Give the Device a Name Give the device an easily identifiable name. This makes it easy for administrators to locate a specific device on an Ethernet network with several devices. Change the Device Password The device password protects its configuration so that only the administrator can modify it. The default password is public. It is a good idea to change the device password to prevent unauthorized changes to it. If the password is not changed from public, you’ll not be prompted for a password when you select it from the list and click Configure. Other Information  Allow configuration over the WAN port. This allows you to administer the wireless device remotely.  Advertise the wireless device over the Internet using Bonjour. If you have an account with a dynamic DNS service, you can connect to it over the Internet.  Set the device time automatically. If you have access to a Network Time Protocol server, whether on your network or on the Internet, choose it from the pop-up menu. This ensures your wireless device is set to the correct time.20 Chapter 3 AirPort Network Designs Set Device Options Click Base Station Options and set the following:  Enter a contact name and location for the wireless device. The name and location are included in some logs the device generates. The contact and location fields may be helpful if you’ve more than one wireless device on your network.  Set status light behavior to either Always On or Flash On Activity. If you choose Flash On Activity, the device status light blinks when there is network traffic.  If your wireless device supports it, select “Check for firmware updates” and choose an increment, such as Daily from the pop-up menu. Wireless Network Settings Click Wireless, and enter the network name, radio mode, and other wireless information. Setting the Wireless Mode AirPort Extreme supports two wireless modes:  Create a wireless network. Choose this option if you’re creating a new AirPort Extreme network.  Extend a wireless network. Choose this option if you plan to connect another Apple wireless device to the network you’re setting up. Naming the AirPort Extreme Network Give your AirPort network a name. This name appears in the AirPort status menu on the AirPort-enabled computers that are in range of your AirPort network.Chapter 3 AirPort Network Designs 21 Choosing the Radio Mode Choose 802.11a/n - 802.11b/g from the Radio Mode pop-up menu if computers with 802.11a, 802.11n, 802.11g, or 802.11b wireless cards will join the network. Each client computer will connect to the network and transmit network traffic at the highest possible speed. Choose 802.11n - 802.11b/g if only computers with 802.11n, 802.11b, or 802.11g compatible wireless cards will join the network. Note: If you don’t want to use an 802.11n radio mode, hold down the Option key and chose a radio mode that doesn’t include 802.11n. Changing the Channel The “channel” is the radio frequency over which your wireless device communicates. If you use only one device (for example, at home), you probably won’t need to change the channel frequency. If you set up several wireless devices in a school or office, use different channel frequencies for devices that are within approximately 150 feet of each other. Adjacent wireless devices should have at least 4 channels between their channel frequencies. So if device A is set to channel 1, device B should be set to channel 6 or 11. For best results, use channels 1, 6, or 11 when operating your device in the 2.4 GHz range. Choose Manually from the Radio Channel Selection pop-up menu, and then click Edit to set the channels manually. AirPort-enabled computers automatically tune to the channel frequency your wireless device is using when they join the AirPort network. If you change the channel frequency, AirPort client computers do not need to make any changes. Password-protect Your Network To password-protect your network, you can choose from a number of wireless security options. In the AirPort pane of AirPort Utility, click Wireless and choose one of the following options from the Wireless Security pop-up menu:  None: Choosing this option turns off all password protection for the network. Any computer with a wireless adapter or card can join the network, unless the network is set up to use access control. See “Setting Up Access Control” on page 47.  WEP: If your device supports it, choose this option and enter a password to protect your network with a Wired Equivalent Privacy (WEP) password. Your Apple wireless device supports 40-bit and 128-bit encryption. To use 40-bit WEP, don’t use an 802.11n radio mode.22 Chapter 3 AirPort Network Designs  WPA/WPA2 Personal: Choose this option to protect your network with Wi-Fi Protected Access. You can use a password between 8 and 63 ASCII characters or a Pre-Shared Key of exactly 64 hexadecimal characters. Computers that support WPA and computers that support WPA2 can join the network. Choose WPA2 Personal if you want only computers that support WPA2 to join your network.  WPA/WPA2 Enterprise: Choose this option if you’re setting up a network that includes an authentication server, such as a RADIUS server, with individual user accounts. Enter the IP address and port number for the primary and optional secondary server, and enter a “shared secret,” which is the password for the server. Choose WPA2 Enterprise if you want only computers that support WPA2 to join the network.  WEP (Transitional Security Network): If your device supports it, you can use this option to allow computers using WPA or WPA2 to join the network. Computers or devices that use WEP can also join the network. WEP (Transitional Security Network) supports 128-bit encryption. To use this option, the wireless device use an 802.11n radio mode. Hold the Option key on your keyboard while clicking the Wireless Security pop-up menu to use WEP (Transitional Security Netowrk). For more information and instructions for setting up WPA or WPA2 on your network, see “Using Wi-Fi Protected Access” on page 45. Setting Wireless Options Click Wireless Options to set additional options for your network.Chapter 3 AirPort Network Designs 23 Setting Additional Wireless Options Use the Wireless Options pane to set the following:  5 GHz network name: Provide a name for the 5 GHz segment of the dual-band network if you want it to have a different name than the 2.4 GHz network.  Country: Choose the country for the location of your network from the Country pop-up menu.  Multicast rate: Choose a multicast rate from the pop-up menu. If you set the multicast rate high, only clients on the network that are within range and can achieve the speed you set will receive transmissions.  Transmit power: Choose a setting from the Transmit Power pop-up menu to set the network range (the lower the percentage, the shorter the network range).  WPA Group Key Timeout: Enter a number in the text field, and choose an increment from the pop-up menu to change the frequency of key rotation.  Use Wide Channels: If you set up your network to use the 5 GHz frequency range, you can use wide channels to provide higher network throughput. Note: Using wide channels is not permitted in some countries.  Create a closed network: Selecting a closed network hides the name of the network so that users must enter the exact network name and password to join the AirPort Extreme network.  Use interference robustness: Interference robustness can solve interference problems caused by other devices or networks. To set more advanced security options, see “Keeping Your Network Secure” on page 45.24 Chapter 3 AirPort Network Designs Setting up a Guest Network Click Guest Network and then enter the network name and other options for the guest network. When you set up a guest network, a portion of your connection to the Internet is reserved for “guests”, wireless clients that can join the guest network and connect to the Internet without accessing your private network. Select “Allow guest network clients to communicate with each other” to allow client computers to share files and services with each other while they’re connected to the guest network. Make sure sharing services are set up on the client computers. Configuring and Sharing Internet Access The next step is setting up your wireless device’s Internet connection and sharing its Internet access with client computers. The following sections tell you what to do, depending on how your device connects to the Internet. You’re Using a DSL or Cable Modem In most cases, you can implement this network design using AirPort Utility and following the onscreen instructions to set up your wireless device and network. You need to use AirPort Utility to manually set up your device only if you want to set up or adjust optional advanced settings.Chapter 3 AirPort Network Designs 25 What It Looks Like How It Works  The Apple wireless device (in this example, a Time Capsule) connects to the Internet through its Internet WAN (<) connection to your DSL or cable modem.  Computers using AirPort or computers connected to the wireless device’s Ethernet LAN port (G) connect to the Internet through the device.  The device is set up to use a single, public IP address to connect to the Internet, and uses DHCP and NAT to share the Internet connection with computers on the network using private IP addresses.  AirPort computers and Ethernet computers communicate with one another through the wireless device. Important: Connect Ethernet computers that are not connected to the Internet to the device’s LAN port (G) only. Since the device can provide network services, you must set it up carefully to avoid interfering with other services on your Ethernet network. What You Need for a DSL or Cable Modem Connection DSL or cable modem to Internet to Ethernet port Time Capsule < Ethernet WAN port 2.4 or 5 GHz Components Check Comments Internet account with DSL or cable modem service provider Does your service provider use a static IP or DHCP configuration? You can get this information from your service provider or the Network preferences pane on the computer you use to access the Internet through this service provider. Apple wireless device (an AirPort Extreme Base Station, an AirPort Express, or a Time Capsule) Place the device near your DSL or cable modem.26 Chapter 3 AirPort Network Designs What to Do If you’re using AirPort Utility to assist you with configuring the Apple wireless device for Internet access: 1 Open AirPort Utility, located in the Utilities folder in the Applications folder on a Mac, or in Start > All Programs > AirPort on a Windows computer. 2 Follow the onscreen instructions and enter the settings you received from your service provider to connect to the Internet, and then set up the device to share the Internet connection with computers on the network. If you’re using AirPort Utility to manually set up your wireless device: 1 Make sure that your DSL or cable modem is connected to the Ethernet WAN port (<) on your Apple wireless device. 2 Open AirPort Utility, located in the Utilities folder in the Applications folder on a Mac, or in Start > All Programs > AirPort on a Windows computer. Select your wireless device and choose Base Station > Manual Setup, or double-click your device’s icon in the list to open the configuration in a separate window. 3 Click the Internet button. Click Internet Connection and choose Ethernet or PPPoE from the Connect Using pop-up menu, depending on which one your service provider requires. If your service provider gave you PPPoE connection software, such as EnterNet or MacPoET, choose PPPoE. Note: If you’re connecting to the Internet through a router using PPPoE and your Apple wireless device is connected to the router via Ethernet, you do not need to use PPPoE on your wireless device. Choose Ethernet from the Connect Using pop-up menu in the Internet pane, and deselect the “Distribute IP addresses” checkbox in the Network pane. Contact your service provider if you aren’t sure which one to select. 4 Choose Manually or Using DHCP from the Configure IPv4 pop-up menu if you chose Ethernet from the Connect Using pop-up menu, depending on how your service provider provides IP addresses.  If your provider gave you an IP address and other numbers with your subscription, use that information to configure the wireless device IP address manually. If you aren’t sure, ask your service provider. Enter the IP address information in the fields below the Configure IPv4 pop-up menu.Chapter 3 AirPort Network Designs 27  If you chose PPPoE, your ISP provides your IP address automatically using DHCP. If your service provider asks you for the MAC address of your wireless device, use the address of the Ethernet WAN port (<), printed on the label on the bottom of the device. If you’ve already used AirPort Utility to set up your wireless device, the fields below the Configure IPv4 pop-up menu may already contain the information appropriate for your service provider. You can change the WAN Ethernet speed if you have specific requirements for the network you’re connected to. In most cases, the settings that are configured automatically are correct. Your service provider should be able to tell you if you need to adjust these settings. Changing the WAN Ethernet speed can affect the way the wireless device interacts with the Internet. Unless your service provider has given you specific settings, use the automatic settings. Entering the wrong settings can affect network performance. Contact your service provider for the information you should enter in these fields. Use this pop-up menu if you need to adjust the speed of the Ethernet WAN port.28 Chapter 3 AirPort Network Designs If you configure TCP/IP using DHCP, choose Using DHCP from the Configure IPv4 pop-up menu. Your IP information is provided automatically by your ISP using DHCP. 5 If you chose PPPoE from the Connect Using pop-up menu, enter the PPPoE settings your service provider gave you. Leave the Service Name field blank unless your service provider requires a service name. Note: With AirPort, you don’t need to use a third-party PPPoE connection application. You can connect to the Internet using AirPort. Your service provider may require you to enter information in these fields. Contact your service provider for the information you should enter in these fields.Chapter 3 AirPort Network Designs 29 If you’re connecting to the Internet through a router that uses PPPoE to connect to the Internet, and your wireless device is connected to the router via Ethernet, you do not need to use PPPoE on your device. Choose Ethernet from the Connect Using pop-up menu in the Internet pane, and deselect the “Distribute IP addresses” checkbox in the Network pane. Because your router is distributing IP addresses, your wireless device doesn’t need to. More than one device on a network providing IP addresses can cause problems. 6 Click PPPoE to set PPPoE options for your connection.  Choose Always On, Automatic, or Manual, depending on how you want to control when your wireless device is connected to the Internet. If you choose Always On, your device stays connected to your modem and the Internet as long as the modem is turned on. If you choose Automatic, the wireless device connects to the modem, which connects to the Internet when you use an application that requires an Internet connection, such as email or an instant message or web application. If you choose Manual, you need to connect the modem to the Internet when you use an application that requires an Internet connection. If you chose Automatic or Manual from the Connection pop-up menu, you need to choose an increment, such as “10 minutes,” from the “Disconnect if idle” pop-up menu. If you don’t use an Internet application after the increment of time has passed, you’ll be disconnected from the Internet. Note: If your wireless device is connected to your modem using an Ethernet LAN port, and your modem is connected to the Internet using PPPoE, you may not be able to use the manual setting.30 Chapter 3 AirPort Network Designs  Enter Domain Name System (DNS) server addresses and a specific domain name your wireless device accesses when you connect to the Internet. 7 Click the Network button and configure how the device will share its Internet access with AirPort and Ethernet computers. If you chose Ethernet from the Connect Using pop-up menu, choose how your device will share the Internet connection from the Connection Sharing pop-up menu.  To share a single Internet connection with AirPort computers and computers connected to the device with Ethernet using DHCP and NAT, choose “Share a public IP address” from the Connection Sharing pop-up menu. Using DHCP and NAT lets the wireless device dynamically and automatically assign IP addresses to client computers, which simplifies each computer’s TCP/IP configuration. See “Setting DHCP and NAT Options” on page 31. By default, the wireless device allows other devices, computers using Ethernet, and computers using AirPort to communicate with each other using non-IP protocols like AppleTalk. If you want to connect an AppleTalk Ethernet printer to the Apple wireless device or use AppleTalk between wired and wireless computers, make sure the devices are connected to the Ethernet LAN port (G) on the device.  To distribute a range of IP addresses using only DHCP, choose “Distribute a range of IP addresses.” See “Setting DHCP Only Options” on page 33.Chapter 3 AirPort Network Designs 31  If you don’t want your wireless device to share its IP address, choose “Off (Bridge Mode).” If you set up your device in bridge mode, AirPort computers have access to all services on the Ethernet network, and the device does not provide Internet sharing services. See “You’re Using an Existing Ethernet Network” on page 37 for more information about setting up your wireless device as a bridge. Using the wireless device as a bridge can be a way to address incompatibilities between the device’s Internet sharing features and your ISP’s connection method. Setting DHCP and NAT Options If you chose “Share a public IP address” from the Connection Sharing pop-up menu, you can set DHCP and NAT options. Click DHCP.  Choose a range of IP addresses from the DHCP Range pop-up menu. Choose 10.0, 192.168, or 172.16 and then enter a beginning and ending address in the DHCP Beginning Address and the DHCP Ending Address fields, depending on which addresses you want the wireless device to provide.  Enter a number in the DHCP Lease field, and then choose minutes, hours, or days from the pop-up menu.  Type a welcome message in the DHCP Message field. This message is displayed when a computer joins your network.  If your network is set up to use a Lightweight Directory Access Protocol (LDAP) server on your network, you can enter the address of the server in the LDAP Server field, and computers on your network will have access to it.32 Chapter 3 AirPort Network Designs  To provide specific IP addresses to specific computers on your wireless network, click the Add (+) button below the DHCP Reservations list, and follow the onscreen instructions to name the reservation and reserve the address by MAC address or DHCP client ID. If you choose MAC address, click Continue and enter the MAC address and specific IP address. Next you can set NAT options for the network. Click NAT.  You can set up a default host on your network. A default host (sometimes known as a DMZ) is a computer on your network that is exposed to the Internet and receives all inbound traffic. A default host may be useful if you use a computer on your AirPort network to play network games, or want to route all Internet traffic through a single computer.  You can set up NAT Port Mapping Protocol (NAT-PMP). NAT-PMP is an Internet Engineering Task Force Internet Draft, an alternative to the more common Universal Plug and Play (UPnP) protocol implemented in many network address translation (NAT) routers. NAT-PMP allows a computer in a private network (behind a NAT router) to automatically configure the router to allow parties outside the private network to contact this computer. Included in the protocol is a method for retrieving the public IP address of a NAT gateway, allowing a client to make this public IP address and port number known to peers that may wish to communicate with it. This protocol is implemented in current Apple products, including Mac OS X 10.4 Tiger and later, AirPort Extreme, AirPort Express, and Time Capsule networking products, and Bonjour for Windows.Chapter 3 AirPort Network Designs 33 You can also set up port mapping. To ensure that requests are properly routed to your web, AppleShare, or FTP server, or a specific computer on your network, you need to establish a permanent IP address for the server or computer, and provide “inbound port mapping” information to the Apple wireless device. See “Directing Network Traffic to a Specific Computer on Your Network (Port Mapping)” on page 49. Setting DHCP Only Options If you chose “Distribute a range of IP addresses” from the Connection Sharing pop-up menu, your wireless device is set up to use DHCP to distribute a range of IP addresses using only DHCP. You cannot use NAT if you chose this option. Click DHCP and enter the beginning and ending addresses you want to distribute to computers joining your wireless network. You can set the additional DHCP options, such as DHCP Lease, DHCP Message, and other options following the instructions above. Setting Up Client Computers To configure TCP/IP on client computers using Mac OS X v10.5: 1 Open System Preferences on the client computer and then click Network. 2 Do one of the following: a If the client computer is using AirPort, select AirPort in the network connection services list, and then click Advanced.34 Chapter 3 AirPort Network Designs Next, choose DHCP from the Configure IPv4 pop-up menu. b If you enabled a DHCP server when you set up the wireless device’s network, and the client computer is using Ethernet, select Ethernet in the network connection services list, and then choose Using DHCP from the Configure pop-up menu.Chapter 3 AirPort Network Designs 35 c If you selected “Distribute a range of IP addresses” when you set up the wireless device’s network, you can provide Internet access to client computers using Ethernet by setting the client IP addresses manually. Select Ethernet in the network connection services list, and then choose Manually from the Configure pop-up menu. When you configure Ethernet clients manually for a wireless device that provides NAT over Ethernet, you can use IP addresses in the range 10.0.1.2 to 10.0.1.200. In the Subnet Mask field, enter 255.255.255.0. In the Router field, enter 10.0.1.1. Enter the same name server address and search domain information that you entered in the wireless device configuration. To configure TCP/IP on client computers using Windows Make sure you’ve installed the wireless adapter in your computer and the software necessary to set up the adapter. To configure TCP/IP on client computers: 1 Open Control Panel from the Start menu, and then click “Network and Internet.” 2 Click “Network and Sharing Center.” 3 Click “Manage network connections” in the Tasks list. 4 Right-click the wireless connection you want to share, and then select Properties. Enter the IP and router addresses from the range your device is providing. Enter the DNS and Search Domain addresses if necessary.36 Chapter 3 AirPort Network Designs 5 Click Internet Protocol Version 4 (TCP/IPv4), and then click Properties.  If you chose “Share a public IP address” in the Network pane of AirPort Utility, select “Obtain an IP address automatically.”  If you chose “Distribute a range of IP addresses” when you set up the wireless device’s network, you can provide Internet access to client computers by setting the client IP addresses manually. Select “Use the following IP address.” When you configure clients manually for a wireless device that provides NAT service, use IP addresses in the range 10.0.1.2 to 10.0.1.200, 172.16.1.2 to 172.16.1.200, or 192.168.1.2 to 192.168.1.200. In the “Subnet mask” field, enter 255.255.255.0. In the “Default gateway” field, enter 10.0.1.1, 172.16.1.1, or 192.168.1.1, depending on which addressing scheme you used. Enter the same name server address and search domain information that you entered in the wireless device configuration.Chapter 3 AirPort Network Designs 37 You’re Using an Existing Ethernet Network You can use AirPort Utility to easily set up the Apple wireless device for Internet access through an existing Ethernet network that already has a router, switch, or other network device providing IP addresses. Use the manual setup features of AirPort Utility if you need to adjust optional advanced settings. What It Looks Like How It Works  The Apple wireless device (in this example, a Time Capsule) uses your Ethernet network to communicate with the Internet through the Ethernet WAN port (<).  AirPort and Ethernet clients access the Internet and the Ethernet network through the Apple wireless device. What You Need for an Ethernet Connection Router to Internet to Ethernet port Time Capsule All Programs > AirPort on a Windows computer. 2 Click Continue and follow the onscreen instructions to connect to your local area network (LAN). If you’re using AirPort Utility to manually set up your wireless device: 1 Open AirPort Utility, located in the Utilities folder in the Applications folder on a Mac, or in Start > All Programs > AirPort on a Windows computer. 2 Select your device and choose Base Station > Manual Setup, or double-click your device icon to open the configuration in a separate window. 3 Click Internet and choose Ethernet from the Connect Using pop-up menu. 4 Choose Manually or Using DHCP from the Configure IPv4 pop-up menu, depending on how IP addresses are provided on your Ethernet network. If you aren’t sure, ask your service provider or network administrator. If your addresses are provided manually, choose Manually from the Configure IPv4 pop-up menu. Enter your IP address information in the fields below the Configure IPv4 pop-up menu. If you’ve already used AirPort Utility to set up your Apple wireless device, the fields below the Configure IPv4 pop-up menu may already contain the appropriate information. Contact your network administrator for the information you should enter in these fields.Chapter 3 AirPort Network Designs 39 If your IP address is provided by DHCP, choose Using DHCP from the Configure IPv4 pop-up menu. 5 Choose Off (Bridge Mode) from the Connection Sharing pop-up menu. Your wireless device “bridges” the Ethernet networks Internet connection to computers connected to the device wirelessly or by Ethernet. See “Setting Up Client Computers” on page 33 for information about how to set up client computers to connect to the Ethernet network.40 Chapter 3 AirPort Network Designs Connecting Additional Devices to Your AirPort Extreme Network Connect a USB printer to the USB port of your Apple wireless device (in this example, a Time Capsule) and everyone on the network can print to it. Connect a USB hub to the USB port of an AirPort Extreme Base Station or a Time Capsule, and then connect a hard disk and a printer so everyone on the network can access them. If you connect a Time Capsule, you can use Time Machine in Mac OS X Leopard (v10.5.2 or later) to back up all of the Mac OS X Leopard computers on the network. What It Looks Like What to Do Follow the instructions in the previous sections to set up your AirPort Extreme network depending on how you connect to the Internet or set up your wireless network. Connect a USB hard disk, printer, or hub to the USB port on your AirPort Extreme Base Station or Time Capsule. Note: If you’re using an AirPort Express in your network, you can connect a USB printer to the USB port, and everyone on the network can print to it. AirPort Express doesn’t support connecting a USB hard disk. DSL or cable modem USB Printer Time Capsule to Internet Ethernet WAN port AirPort Extreme < 2.4 or 5 GHz 2.4 or 5 GHz 2.4 or 5 GHzChapter 3 AirPort Network Designs 41 Using Apple TV on Your AirPort Extreme Network to Play Content from iTunes When you connect Apple TV to your AirPort Extreme network wirelessly, or using Ethernet, and then connect Apple TV to your widescreen TV, you can enjoy your favorite iTunes content including movies, TV shows, music, and more. (See the documentation that came with your Apple TV for instructions setting it up.) Setting Advanced Options Connecting Additional Wireless Devices to Your AirPort Network You can connect additional Apple wireless devices to extend the range of your wireless network. For example, you can connect an AirPort Extreme Base Station or a Time Capsule using Ethernet. A network with devices connected using Ethernet is known as a roaming network. You can also connect Apple wireless devices wirelessly to extend the network. DSL or cable modem to Internet to Ethernet port < Ethernet WAN port Time Capsule Apple TV 2.4 GHz 2.4 or 5 GHz42 Chapter 3 AirPort Network Designs Setting Up Roaming Several AirPort Extreme Base Stations or Time Capsules can be set up to create a single wireless network. Client computers using AirPort can move from device to device with no interruption in service (a process known as roaming). To set up roaming: 1 Connect all of the AirPort Extreme Base Stations and Time Capsules to the same subnet on your Ethernet network. 2 Give each device a unique name. 3 Give each device the same network name and password. 4 Set up the devices as bridges, following the instructions in the previous section. If you want one device to assign IP addresses using DHCP, also do the following: 1 Set up one device to act as the DHCP server. 2 Set up the other devices as bridges, following the instructions in the previous section. The device acting as a DHCP server can also receive its IP address via DHCP from a server on an Ethernet network or from a cable or DSL modem connected to an Internet service provider (ISP). to Ethernet port Ethernet LAN ports to Internet AirPort Extreme DSL or cable modem G Time Capsule < Ethernet WAN port 2.4 or 5 GHz 2.4 GHzChapter 3 AirPort Network Designs 43 Extending the Range of an 802.11n Network Extending the range of an 802.11n network is simpler if you’re connecting another 802.11n device. Connecting two Apple 802.11n wireless devices makes the WDS setup process more straightforward. To extend the range of an 802.11n network: 1 Open AirPort Utility and select the device that will connect to the Internet. See the previous sections of this document for instructions about setting up your wireless device, depending on your Internet connection. 2 Choose Base Station > Manual Setup, or double-click the device’s icon to open the configuration in a separate window. Enter the password if necessary. 3 Click the AirPort button, and then click Wireless. 4 Choose “Create a wireless network” from the Wireless Mode pop-up menu, and then select the “Allow this network to be extended” checkbox. 5 Next, select the device that will extend this network and choose Base Station > Manual Setup, or double-click the device’s icon to open its configuration in a separate window. Enter the password if necessary. 6 Choose “Extend a wireless network” from the Wireless Mode pop-up menu, and then choose the network you want to extend from the Network Name pop-up menu. 7 Enter the network name and password if necessary.44 Chapter 3 AirPort Network Designs 8 Click Update to update the device with new network settings. Controlling the Range of Your AirPort Network You can also shorten the range of your AirPort network. This might be useful if you want to control who has access to the network by restricting the range to a single room, for example. To shorten the range of your AirPort network: 1 Open AirPort Utility (in the Utilities folder in the Applications folder on a Macintosh computer, or in Start > All Programs > AirPort on a computer using Windows). 2 Select your wireless device and choose Base Station > Manual Setup, or double-click the device icon to open its configuration in a separate window. Enter the password if necessary. 3 Click the AirPort button, and then click Wireless. 4 Click Wireless Options, and then choose a percentage setting from the Transmit Power pop-up menu. The lower the percentage is, the shorter the range is.Chapter 3 AirPort Network Designs 45 Keeping Your Network Secure Your network is protected by the password you assign to it. However, you can take additional steps to help keep your network secure. Networks managed by Simple Network Management Protocol (SNMP) may be vulnerable to denial-of-service attacks. Similarly, if you configure your wireless device over the WAN port, it may be possible for unauthorized users to change network settings. When remote configuration is enabled, the device’s Bonjour information (the device name and IP address) is published over the WAN port. Turning off remote configuration may provide additional security. To help protect your network and wireless device: 1 Open AirPort Utility, select your device, and choose Base Station > Manual Setup, or double-click the device icon to open its configuration in a separate window. Enter the password if necessary. 2 Click the Advanced button, and then click Logging & SNMP. 3 Make sure the Allow SNMP Access and “Allow SNMP over WAN” checkboxes are not selected. Using Wi-Fi Protected Access AirPort Extreme supports WPA and WPA2 security standard for wireless networks. Using Mac OS X v10.3 or later or Windows XP with Service Pack 2, and 802.1X authentication capabilities, WPA security delivers more sophisticated data encryption than WEP, and also provides user authentication, which was virtually unavailable with WEP. If your computer has an AirPort Extreme wireless card installed, you can take advantage of the security updates in WPA2, including AES-CCMP encryption. AirPort Extreme supports two modes of WPA and WPA2: Enterprise mode, which uses an authentication server for user authentication, and Personal mode, which relies on the capabilities of TKIP for WPA and AES-CCMP for WPA2, without requiring an authentication server. Enterprise mode is designed for a larger network in which an IT professional is most likely setting up and managing the network. In order to set up a WPA or WPA2 Enterprise network, an 802.1X connection must be set up first in Network preferences on a Mac. To set up an 802.1x connection on a Windows computer, see the documentation that came with your computer. The 802.1X connection requires an authentication protocol, like TTLS, LEAP, or PEAP. Setting up a WPA or WPA2 Enterprise network requires setting up an authentication server, such as a RADIUS server, to manage and validate network users’ credentials, such as user names, passwords, and user certificates. See the documentation that came with the server to set it up. 46 Chapter 3 AirPort Network Designs Personal mode is for the home or small office network and can be set up and managed by most users. Personal mode does not require a separate authentication server. Network users usually only need to enter a user name and password to join the network. Note: If you change an existing WDS network from WEP to WPA, you’ll need to reset the wireless devices and set up your network again. For information about resetting your Apple wireless device, see the documentation that came with it. To set up a WPA or WPA2 Enterprise network: On a computer using Mac OS X, you first need to set up an 802.1x connection. 1 Open System Preferences, click Network, and then click AirPort. 2 Click Advanced, and then click 802.1X 3 Enter the settings for the connection. Note: Some of the authentication protocols require digital certificate authorization on the server. See the documentation that came with your server to create and distribute digital certificates. 4 Click OK to save the connection settings. To use AirPort Utility to set up a WPA or WPA2 Enterprise network on computers using Mac OS X and Windows XP: 1 Open AirPort Utility, select your wireless device, and then choose Base Station > Manual Setup, or double-click the device icon to open its configuration in a separate window. Enter the password if necessary. 2 Choose WPA/WPA2 Enterprise, or WPA2 Enterprise from the Wireless Security pop-up menu, depending on the capabilities of the client computers that will join your network. 3 Click Configure RADIUS, and enter the IP address, port, and shared secret (or password) of the primary and secondary RADIUS authentication servers. Check with the administrator of the RADIUS server for information to type in these fields. To set up a WPA or WPA2 Personal network: 1 Open AirPort Utility, select your wireless device, and then choose Base Station > Manual Setup, or double-click the device icon to open its configuration in a separate window. Enter the password if necessary. 2 Choose WPA/WPA2 Personal or WPA2 Personal from the Wireless Security pop-up menu depending on the capabilities of the client computers that will join your network. 3 Type a password of 8 to 63 ASCII characters.Chapter 3 AirPort Network Designs 47 Setting Up Access Control Access control lets you specify which computers can send or receive information through the wireless device to the wired network. Each wireless-enabled computer has a unique MAC address. You can restrict access by creating an access control list that includes only the MAC addresses for computers you want to access your wired network. To find the MAC address (AirPort ID) of your computer’s AirPort Card, click the AirPort button in the Network pane of System Preferences. To set up the access control list: 1 Open AirPort Utility, select your wireless device, and then choose Base Station > Manual Setup. Enter the password if necessary. 2 Click the AirPort button, and then click Access. 3 Choose Timed Access or RADIUS from the MAC Address Access Control pop-up menu, depending on the device you’re setting up.  If you choose Timed Access, click the Add (+) button and enter the MAC address and description or name of the computers you’re allowing to access the network. You can also click This Computer to add the MAC address and name of the computer you’re using to set up this wireless device. Double-click the computer in the list and choose a value from each pop-up menu. Choose a day of the week or Everyday from the day pop-up menu, and then choose either “all day” or “between” from the other pop-up menu. If you choose “between,” you can edit the times of the day by double-clicking in the time fields.48 Chapter 3 AirPort Network Designs  If you choose RADIUS, enter the type of RADIUS service, the RADIUS IP addresses, shared secret, and primary port for the primary RADIUS server. Enter the information for the secondary RADIUS server if there is one. Check with the server administrator if you don’t have that information. Important: AirPort access control prevents computers that aren’t on the access control list from accessing the AirPort network. For information on how to prevent unauthorized computers from joining the AirPort network, see “Setting Up the AirPort Extreme Network” on page 17. You can also add the MAC address of a third-party 802.11 wireless networking card to the access control list. Most third-party cards have the MAC address on a label attached to the metal case of the card. Access control is not compatible with WPA or WPA2 Enterprise mode. You can use either access control or WPA Enterprise in a network, but you can’t use both. Using a RADIUS Server Using a RADIUS server on your network lets you authenticate MAC addresses (AirPort IDs) on a separate computer, so that each device on the network doesn’t need to store the MAC addresses of computers that have access to the network. Instead, all the addresses are stored on a server that is accessed through a specific IP address. To set up authentication using a RADIUS server: 1 On the server, enter the MAC addresses of the computers that will access the network. 2 When the RADIUS server is set up, open AirPort Utility, select your wireless device, and then choose Base Station > Manual Setup, or double-click the device icon to open its configuration in a separate window. Enter the password if necessary. 3 Click AirPort, click Access, and then choose RADIUS from the MAC Address Access Control pop-up menu. 4 Choose a format from the RADIUS pop-up menu. If you choose Default, your wireless device formats the MAC addresses as 010203- 0a0b0c, and they are used as the user names on the RADIUS server. The shared secret is the password for users joining the network. This format is often used for Lucent and Agere servers. If you choose Alternate, MAC addresses are formatted as 0102030a0b0c and are used for both the user name and password by users joining the network. This format is often used for Cisco servers.Chapter 3 AirPort Network Designs 49 5 Enter the IP address, port, and shared secret (or password) for the primary and secondary servers. See the RADIUS documentation that came with your server, or check with the network administrator for more information on setting up the RADIUS server. The access control list and RADIUS work together. When a user tries to join a network that authenticates using access control or a RADIUS server, the wireless device searches first in the access control list, and if the MAC address is there, the user can join the network. If the MAC address is not in the access control list, the device checks the RADIUS server for the MAC address. If it is there, the user can join the network. Note: RADIUS access control is not compatible with WPA or WPA2 Personal mode. You can use either RADIUS access control or WPA Enterprise in a network, but you can’t use both. Directing Network Traffic to a Specific Computer on Your Network (Port Mapping) AirPort Extreme uses Network Address Translation (NAT) to share a single IP address with the computers that join the AirPort Extreme network. To provide Internet access to several computers with one IP address, NAT assigns private IP addresses to each computer on the AirPort Extreme network, and then matches these addresses with port numbers. The wireless device creates a port-to-private IP address table entry when a computer on your AirPort (private) network sends a request for information to the Internet. 50 Chapter 3 AirPort Network Designs If you’re using a web, AppleShare, or FTP server on your AirPort Extreme network, other computers initiate communication with your server. Because the Apple wireless device has no table entries for these requests, it has no way of directing the information to the appropriate computer on your AirPort network. To ensure that requests are properly routed to your web, AppleShare, or FTP server, you need to establish a permanent IP address for your server and provide inbound port mapping information to your Apple wireless device. To set up inbound port mapping: 1 Open AirPort Utility, select your wireless device, and then choose Base Station > Manual Setup, or double-click the device icon to open its configuration in a separate window. Enter the password if necessary. 2 Click the Advanced button, and then click Port Mapping. 3 Click the Add (+) button and choose a service, such as Personal File Sharing, from the Service pop-up menu.Chapter 3 AirPort Network Designs 51 Type any additional information you need in the text fields. To use port mapping, you must configure TCP/IP manually on the computer that is running the web, AppleShare, or FTP server. You can also set up a computer as a default host to establish a permanent IP address for the computer and provide inbound port mapping information to the AirPort Extreme Base Station or AirPort Express. This is sometimes known as a DMZ and is useful when playing some network games or video conferencing. To set up a default host: 1 Open AirPort Utility, select your wireless device, and then choose Base Station > Manual Setup, or double-click the device icon to open its configuration in a separate window. Enter the password if necessary. 2 Click the Internet button, and then click NAT. 3 Select the “Enable Default Host at” checkbox. The default IP address is 10.0.1.253. 4 Enter the same IP address on the host computer. Logging You can set up your wireless device to log status information to the Mac OS X system log or the Syslog application on a Windows computer. This is helpful for understanding problems and monitoring a device’s performance. To set up logging: 1 Open AirPort Utility, select your wireless device, and then choose Base Station > Manual Setup, or double-click the device icon to open its configuration in a separate window. Enter the password if necessary. 2 Click the Advanced button, and then click Statistics.52 Chapter 3 AirPort Network Designs 3 Enter the IP address of the computer that will receive the logs in the Syslog Destination Address field. 4 Choose a level from the Syslog Level pop-up menu. You need to assign a Network Time Protocol (NTP) server for each wireless device, so the log information will contain the accurate time of the status logs. To set the time automatically: 1 Open AirPort Utility, select your wireless device, and then choose Base Station > Manual Setup, or double-click the device icon to open its configuration in a separate window. Enter the password if necessary. 2 Click the AirPort button, and then click Base Station. 3 Select the “Set time automatically” checkbox, and then choose an NTP server from the pop-up menu if you have access to one on your network or on the Internet. If you click “Logs and Statistics” you can view and export logs, and view wireless client and DHCP client information. If you export the logs, use the Mac OS X Console application, located in the Utilities folder in the Applications folder on a Mac, or in Start > All Programs > AirPort on a Windows computer, to view the logs on the computer receiving them. Using Back to My Mac on your Wireless Network If you have a paid MobileMe subscription (not a free trial), you can use Back to My Mac to access your AirPort Base Station or Time Capsule. You can access the base station or Time Capsule to monitor the network or make changes to the base station or Time Capsule settings. You can also access the hard disk built into the Time Capsule or an external USB hard disk connected to the base station or Time Capsule. To set up Back to My Mac on your wireless device: 1 Click MobileMe in the Advanced pane. 2 Enter your MobileMe account and password.Chapter 3 AirPort Network Designs 53 Setting up IPv6 IPv6 is a new version of Internet Protocol (IP). IPv6 is currently used primarily by some research institutions. Most computers do not need to set up or use IPv6. The primary advantage of IPv6 is that it increases the address size from 32 bits (the current IPv4 standard) to 128 bits. An address size of 128 bits is large enough to support billions and billions of addresses. This allows for more addresses or nodes than are currently available. IPv6 also provides more ways to set up the address and simpler autoconfiguration. By default, IPv6 is configured automatically, and the default settings are sufficient. However, if your network administrator or Internet service provider (ISP) has specifically told you to configure IPv6 manually, follow the instructions below. Open AirPort Utility, select your wireless device, and then choose Base Station > Manual Setup. Enter the password if necessary. Click the Advanced button, and then click IPv6. To manually set IPv6 options: 1 Choose Node or Tunnel from the IPv6 mode pop-up menu, depending on the method you were instructed to use. 2 Choose Manually from the Configure IPv6 pop-up menu, and enter the information you were given from your ISP or network administrator. Customizing the IPv6 firewall If your wireless device supports it, you can use AirPort Utility to adjust IPv6 firewall settings. To adjust IPv6 firewall settings: 1 Open AirPort Utility, located in the Utilities folder in the Applications folder on a Mac, or in Start > All Programs > AirPort on a Windows computer. 2 Select your device from the list, and then enter the password. 3 Click the Advanced button, and then click IPv6 Firewall By default, “Allow Teredo tunnels” and “Allow incoming IPSec authentication” are selected. To provide access to specific devices on your network from outside the IPv6 firewall, click the Add (+) button and enter the IPv6 address and/or the port for the device. To use an IPv6 firewall, you need an Apple 802.11n wireless device.54 Chapter 3 AirPort Network Designs Sharing and Securing USB Hard Disks on Your Network If you connect a USB hard disk to your AirPort Extreme Base Station or Time Capsule, computers connected to the network—both wireless and wired, Mac and Windows— can use it to back up, store, and share files. If you’re using a Time Capsule, you don’t need to connect a hard disk to it. Every Time Capsule includes an internal AirPort disk. To share a hard disk on your network: 1 Plug the hard disk into the USB port on the back of the AirPort Extreme Base Station or Time Capsule. 2 Open AirPort Utility, located in the Utilities folder in the Applications folder on a Mac, or in Start > All Programs > AirPort on a Windows computer. 3 Select your AirPort Extreme Base Station or your Time Capsule, and then choose Base Station > Manual Setup, or double-click the device icon to open its configuration in a separate window. Enter the password if necessary. 4 Click the Disks button, and then click File Sharing. 5 Choose “With a disk password,” or “With base station password” if you want to secure the shared disk with a password, or choose “With accounts” if you want to secure the disk using accounts.  If you choose to use accounts, click Configure Accounts, click the Add (+) button, and then enter a name and password for each user that will access the disk. 6 Choose “Not allowed,” “Read only,” or “Read and write” to assign guest access to the disk. 7 Select the “Share disks over Ethernet WAN port” checkbox if you want to provide remote access to the disk over the WAN port. Data transfer speed may vary, depending on the network. to Internet DSL or cable modem AirPort Extreme USB hard disk < Ethernet WAN port 2.4 or 5 GHz 2.4 or 5 GHzChapter 3 AirPort Network Designs 55 Using a Time Capsule in Your Network If you’re using a Time Capsule and a computer with Mac OS X Leopard (v10.5.2 or later), you can use Time Machine to automatically back up all of the computers on the network that are using Leopard. Other Mac computers and Windows computers can access the Time Capsule’s internal AirPort disk to back up, store, and share files. And because every Time Capsule is also a full-featured 802.11n base station, you can set up your Time Capsule to share an Internet connection with computers on the AirPort network it creates. For information about using your Time Capsule with Time Machine in Mac OS X Leopard, search for “Time Capsule” in Mac Help. Connecting a USB Printer to an Apple Wireless Device You can connect a compatible USB printer to your Apple wireless device (an AirPort Extreme Base Station, AirPort Express, or Time Capsule), so that anyone on the network using Mac OS X v10.2.3 or later, Windows XP with Service Pack 2, or Windows Vista can print to that printer. To use a printer on your network: 1 Connect the printer to the USB port on the Apple wireless device. 2 Set up the client computers:  On a computer using Mac OS X v10.5 or later, open System Preferences and click Print & Fax. Select the printer from the Printers list. If the printer isn’t in the list, click Add (+) at the bottom of the list, locate the printer, and then click Add.  On a computer using Mac OS X v10.2.3 or later, open Printer Setup Utility located in the Utilities folder in the Applications folder, and then select the printer from the list. If the printer is not in the list, click Add, choose Bonjour from the pop-up menu, and then select the printer from the list. to Internet DSL or cable modem Time Capsule < Ethernet WAN port 2.4 or 5 GHz 2.4 or 5 GHz 2.4 GHz56 Chapter 3 AirPort Network Designs  On a computer using Windows, install Bonjour for Windows from AirPort Utility CD, and follow the onscreen instructions to connect to the printer. You can change the name of the printer from the default name to one you choose. To change the name of your USB printer: 1 Open AirPort Utility, select your device, and then choose Base Station > Manual Setup, or double-click the device icon to open its configuration in a separate window. 2 Click the Printer button and type a name for the printer in the USB Printers field. Adding a Wireless Client to Your 802.11n Network If your Apple wireless device supports it, and your network is password-protected using WPA Personal or WPA/WPA2 Personal, you can provide wireless clients access to your network without requiring them to enter the network password. When you allow a client access to your network, the client’s name and wireless MAC address (or AirPort ID) are stored in the access control list of AirPort Utility until you remove them from the list. You can provide 24 hours of access, after which time the client will no longer be able to access your network. When you provide a client access to your wireless network, the client does not need to enter the network password. To allow client access to your network: 1 Open AirPort Utility, located in the Utilities folder in the Applications folder on a Mac, or in Start > All Programs > AirPort on a Windows computer. 2 Select your Apple wireless device and choose Base Station > Manual Setup. Enter the password if necessary. 3 Choose Add Wireless Clients from the Base Station menu. 4 Select how you want the client to access the network:  Select PIN to enter the eight-digit number provided by the client requesting network access.  Select “First attempt” to allow network access to the first client attempting to join the network.  Select “Limit client’s access to 24 hours” if you want to provide only one day of access to your network. If you don’t select this option, the client will have access to your network until you remove the name from the list.Chapter 3 AirPort Network Designs 57 Solving Problems If you have trouble connecting to the Internet with any AirPort Extreme network design, try the following: On a computer using Mac OS X:  Make sure the wireless device is connected to the Internet. The computers on your AirPort network cannot connect to the Internet if your device is not connected to the Internet.  Check your Internet connection using your computer. If you can’t connect with your computer, the problem may be with your Internet connection.  On a Mac using Mac OS X v10.5, check the active network services in the Network pane of System Preferences. Make sure the ports you want to use are active.  Open Network preferences and then click AirPort. Make sure that the computer has joined the AirPort network created by your wireless device.  Restart your computer. This renews the IP address you receive from the wireless device. The IP addresses should be in the range of 10.0.1.2 to 10.0.1.200, 172.16.1.2 to 172.16.1.200, or 192.168.1.2 to 192.168.1.200, depending on the address scheme the wireless device uses.  If the wireless device is set up as a DHCP server, make sure you choose “Share a public IP address” from the Connection Sharing pop-up menu on the Internet Connection pane of Internet settings in AirPort Utility.  If you’re using a cable modem and your wireless device cannot connect to the Internet, turn off the cable modem, wait a few minutes, and then turn it on again. On a computer using Windows:  Make sure the wireless device is connected to the Internet. The computers on your AirPort network cannot connect to the Internet if your device is not connected to the Internet.  Check your Internet connection using your computer. If you can’t connect with your computer, the problem may be with your Internet connection.  Right-click the wireless connection icon, and then choose Status.58 Chapter 3 AirPort Network Designs  Make sure that the computer has joined the AirPort network created by your wireless device.  Restart your computer. This renews the IP address you receive from the wireless device. The IP addresses should be in the range of 10.0.1.2 to 10.0.1.200, 172.16.1.2 to 172.16.1.200, or 192.168.1.2 to 192.168.1.200 depending on the address scheme the device uses.  If the device is set up as a DHCP server, make sure the “Obtain an IP address automatically” checkbox is selected in the General pane of Internet Protocol (TCP/IP) Properties. Right-click the wireless connection icon and click Properties. Click Internet Protocol (TCP/IP), and then click Properties. More Information About AirPort You can find more information about AirPort in the following locations:  AirPort Utility Help Look in AirPort Utility Help for information on setting up an AirPort Extreme network; using an AirPort Extreme Base Station, an AirPort Express, or a Time Capsule; editing settings; avoiding sources of interference; locating additional information on the Internet; and more. On a computer using Mac OS X, open AirPort Utility and choose Help > AirPort Utility Help. On a computer using Windows, open AirPort Utility and click Help.  World Wide Web Apple AirPort website at www.apple.com/airportextreme Apple Support website at www.apple.com/support/airport4 59 4 Behind the Scenes This chapter defines terms and concepts used to discuss computer networks. Use it as a reference to help you understand what is taking place behind the scenes of your AirPort wireless network. Basic Networking Packets and Traffic Information travels across a network in chunks called packets. Each packet has a header that tells where the packet is from and where it’s going, like the address on the envelope when you send a letter. The flow of all these packets on the network is called traffic. How Information Reaches Its Destination Hardware Addresses Your computer “listens” to all of the traffic on its local network and selects the packets that belong to it by checking for its hardware address (also called the media access control, or MAC address) in the packet header. This address is a number unique to your computer. Every hardware product used for networking is required to have a unique hardware address permanently embedded in it. Your AirPort Card’s number is called the AirPort ID. IP Addresses Since the Internet is a network of networks (connecting millions of computers), hardware addresses alone are not enough to deliver information on the Internet. It would be impossible for your computer to find its packets in all the world’s network traffic, and impossible for the Internet to move all traffic to every network.60 Chapter 4 Behind the Scenes So, your computer also has an Internet Protocol (IP) address that defines exactly where and in what network it’s located. IP addresses ensure that your local Ethernet network receives only the traffic intended for it. Like the hierarchical system used to define zip codes, street names, and street numbers, IP addresses are created according to a set of rules, and their assignment is carefully administered. The hardware address is like your name; it uniquely and permanently identifies you. But it doesn’t offer any clues about your location, so it’s only helpful in a local setting. An IP address is like your street address, which contains the information that helps letters and packages find your house. Rules for Sending Information (Protocols) A protocol is a set of rules that define how communication takes place. For instance, a networking protocol may define how information is formatted and addressed, just as there’s a standard way to address an envelope when you send a letter. Using the AirPort Extreme Base Station This section describes the different network interfaces of the AirPort Extreme Base Station and describes the functions the base station can provide. Base Station Interfaces To use the AirPort Extreme Base Station, you configure how its networking interfaces will be used. The AirPort Extreme Base Station has five hardware networking interfaces:  AirPort interface: The AirPort interface creates an AirPort network for AirPortenabled computers to join. The base station can provide IP services such as DHCP and NAT using this interface. The base station cannot use the AirPort interface to establish a connection with the Internet.  Ethernet WAN (<) interface: Use the Ethernet WAN interface to connect DSL or cable modems and connect to the Internet.  Ethernet LAN (G) interface: If your base station has one or more Ethernet LAN interface ports, you can use them to provide IP services to local Ethernet clients.  USB (d) interface: Use the USB interface to connect a USB printer or hard disk to the AirPort Extreme Base Station. Status light Ethernet WAN port Power port USB port Ethernet ports Reset button Security slot < G ¯ ∏ dChapter 4 Behind the Scenes 61 Using the Time Capsule This section describes the different network interfaces of the Time Capsule and describes the functions it can provide. Time Capsule Interfaces To use your Time Capsule, you configure how its networking interfaces will be used. The Time Capsule has five hardware networking interfaces:  AirPort interface: The AirPort interface creates an AirPort network for AirPortenabled computers to join. The Time Capsule can provide IP services such as DHCP and NAT using this interface. The Time Capsule cannot use the AirPort interface to establish a connection with the Internet.  Ethernet WAN (<) interface: Use the Ethernet WAN interface to connect DSL or cable modems and connect to the Internet.  Ethernet LAN (G) interface: The Time Capsule has three Ethernet LAN interface ports. You can use them to provide IP services to local Ethernet clients.  USB (d) interface: Use the USB interface to connect a USB printer to the Time Capsule. Using the AirPort Express This section describes the different network interfaces of the AirPort Express Base Station and describes the functions the base station can provide. AirPort Express Interfaces To set up the AirPort Express Base Station, you configure how its networking interfaces will be used. The AirPort Express Base Station has four hardware networking interfaces:  AirPort interface: The AirPort interface creates an AirPort network for AirPortenabled computers to join. The base station can provide IP services such as DHCP and NAT using this interface. The base station cannot use the AirPort interface to establish a connection with the Internet.  Ethernet WAN (<) interface: Use the Ethernet WAN interface to connect DSL or cable modems and connect to the Internet.  USB (d) interface: Use the USB interface to connect a USB printer to the AirPort Extreme Base Station. < G ≤ d ∏ Status light Ethernet WAN port Power port Reset button USB port Ethernet ports Security slot62 Chapter 4 Behind the Scenes  Audio (-) interface: Use the analog and optical digital audio stereo mini-jack to connect an AirPort Express to a home stereo or powered speakers. Apple Wireless Device Functions  Bridge: Each Apple wireless device is configured by default as a bridge between the wireless AirPort network and the wired Ethernet network. Connecting an AirPort network to an Ethernet network through the device’s Ethernet LAN port (G) bridges the wireless AirPort network to the wired Ethernet network. Important: If you’re connecting an Ethernet network to the device’s Ethernet LAN port (G), make sure the Ethernet network does not have an Internet connection.  NAT router: One of the most powerful features of Apple wireless devices is their ability to share one Internet connection with several computers. To provide this service, the device acts as a router. The device can be configured to provide both bridging services and routing services at the same time.  DHCP server: When you configure the wireless device to act as a DHCP server, it provides IP addresses to both wired and wireless client computers that are configured to obtain IP addresses using DHCP. Using DHCP makes IP configuration simple for client computers, since they don’t need to enter their own IP information. Status light AC plug adapter USB port Ethernet port Line Out port (Analog and optical digital audio mini-jack) Reset button G - d ∏Chapter 4 Behind the Scenes 63 Items That Can Cause Interference with AirPort The farther away the interference source, the less likely it is to cause a problem. The following items can cause interference with AirPort communication:  Microwave ovens  DSS (Direct Satellite Service) radio frequency leakage  The original coaxial cable that came with certain types of satellite dishes. Contact the device manufacturer and obtain newer cables.  Certain electrical devices, such as power lines, electrical railroad tracks, and power stations  Cordless telephones that operate in the 2.4 gigahertz (GHz) range. If you have problems with your phone or AirPort communication, change the channel of your base station.  Other AirPort and wireless networks  Adjacent base stations using nearby channels. If base station A is set to channel 1, base station B should be set to channel 6 or 11. For best results, use channels 1, 6, or 11 when operating your base station in the 2.4 GHz range.  Moving objects that temporarily place metal between your computer and the base stationGlossary 64 Glossary 10Base-T The most common cabling method for Ethernet. 10Base-T conforms to IEEE standard 802.3. It was developed to enable data communications over unshielded twisted pair (telephone) wiring at speeds of up to 10 megabits per second (Mbps) up to distances of approximately 330 feet on a network segment. 10/100Base-T A networking standard that supports data transfer rates up to 100 Mbps. Because it is 10 times faster than Ethernet, it is often referred to as Fast Ethernet. 10/100/1000Base-T A term describing various technologies for transmitting Ethernet packets at a rate of a gigabit per second. Sometimes referred to as Gigabit Ethernet. In 2000, Apple’s Power Mac G4 and PowerBook G4 were the first mass-produced personal computers featuring the 10/100/1000Base-T connection. It quickly became a built-in feature in many other computers. 802.11a An IEEE standard for a wireless network that operates at 5 GHz with rates up to 54 Mbps. 802.11b An IEEE standard for a wireless network that operates at 2.4 GHz with rates up to 11 Mbps. 802.11g An IEEE standard for a wireless network that operates at 2.4 GHz Wi-Fi with rates up to 54 Mbps. 802.11n A task group of the IEEE 802.11 committee whose goal is to define a standard for high throughput speeds of at least 100 Mbps on wireless networks. Some proposals being fielded by the task group include designs for up to 540 Mbps, Multiple-input multiple-output (MIMO) technology, using multiple receivers and multiple transmitters in both the client and access point to achieve improved performance, is expected to form the basis of the final specification. See Mbps, MIMO. access point Also known as a wireless access point (WAP), a device that connects wireless devices together to form a network. authentication The process that occurs after association to verify the identity of the wireless device or end user and allow access to the network. See WPA, WPA2.Glossary 65 backbone The central part of a large network that links two or more subnetworks. The backbone is the primary data transmission path on large networks such as those of enterprises and service providers. A backbone can be wireless or wired. bandwidth The maximum transmission capacity of a communications channel at any point in time. Bandwidth, usually measured in bits per second (bps), determines the speed at which information can be sent across a network. If you compare the communications channel to a pipe, bandwidth represents the pipe width and determines how much data can flow through the pipe at any one time. The greater the bandwidth, the faster data can flow. See bps. base station In the area of wireless computer networking, a base station is a radio receiver/transmitter that serves as the hub of the local wireless network, and may also be the gateway between a wired network and the wireless network. A base station can also be referred to as an access point or router. Bluetooth A technology designed for short-range, wireless communications among computing devices and mobile products, including PCs and laptop computers, personal digital assistants, printers, and mobile phones. Designed as a cable replacement, Bluetooth enables short-range transmission of voice and data in the 2.4 GHz frequency spectrum within a range of about 30 feet. bps Bits per second. A measure of data transmission speed across a network or communications channel; bps is the number of bits that can be sent or received per second. It measures the speed at which data is communicated and should not be—but often is—confused with bytes per second. Whereas “bits” is a measure of transmission speed, “bytes” is a measure of storage capacity. See bandwidth, Mbps. bridge A wireless device that connects multiple networks together. Using an access point as a bridge turns off Network Address Translation (NAT) and DHCP routing and simply extends the range of service. broadband A comparatively fast Internet connection possessing sufficient bandwidth to accommodate multiple voice, data, and video channels simultaneously. Cable, DSL, and satellite are all considered to be broadband channels; they provide much greater speed than dial-up Internet access over telephone wires. See cable modem, DSL. broadband modem A device that connects a local computer or network to a highspeed Internet service, such as DSL or Cable Internet. See cable modem, DSL. cable modem A device used with broadband Internet service provided by a traditional cable TV service. Cable modems convert analog data from the cable TV system into a digital format that can be used by a computer. See broadband modem.66 Glossary channel One portion of the available radio spectrum that all devices on a wireless network use to communicate. Changing the channel on the access point/router can help reduce interference. client Any computer or device connected to a network that requests files and services (files, print capability) from the server or other devices on the network. The term also refers to end users. DHCP Dynamic Host Configuration Protocol. A protocol for dynamically assigning IP addresses from a predefined list to nodes on a network. When they log on, network nodes automatically receive an IP address from a pool of addresses served by a DHCP. The DHCP server provides (or leases) an IP address to a client for a specific period of time. The client will automatically request a renewal of the lease when the lease is about to run out. If a lease renewal is not requested and it expires, the address is returned to the pool of available IP addresses. Using DHCP to manage IP addresses simplifies client configuration and efficiently utilizes IP addresses. See IP address. DNS Domain Name System. An Internet service that translates alphanumeric domain names to assigned IP addresses and vice versa. The term is typically used to describe the server that makes the translation. Every website has its own specific IP address on the Internet. DNS typically refers to a database of Internet names and addresses that translates the alphanumeric names to the official Internet Protocol numbers and vice versa. For instance, a DNS server converts a name like mywebsite.com to a series of numbers like 107.22.55.26. See IP, IP address. DSL Digital Subscriber Line. A dedicated digital circuit between a residence or business and a telephone company’s central office. It allows high-speed data, voice, and video transmissions over existing twisted-pair copper plain old telephone service (POTS) telephone wires. See broadband. dual-band A device that is capable of operating in either of two frequencies. On a wireless network, dual-band devices are capable of operating in the 2.4 GHz (802.11b/g) or 5 GHz (802.11a) bands. encryption A mechanism for providing data confidentiality. See WPA, WPA2. Ethernet The most popular international standard technology for wired local area networks (LANs). It provides from 10 Mbps transmission speeds on basic 10Base-T Ethernet networks to 100 Mbps transmission speeds on Fast Ethernet networks, 1000 Mbps on Gigabit Ethernet, and 10,000 Mbps on 10 Gigabit Ethernet.Glossary 67 firewall A system of software and/or hardware that resides between two networks to prevent access by unauthorized users. The most common use of a firewall is to provide security between a local network and the Internet. Firewalls can make a network appear invisible to the Internet and can block unauthorized and unwanted users from accessing files and systems on the network. Hardware and software firewalls monitor and control the flow of data in and out of computers in both wired and wireless enterprise, business and home networks. They can be set to intercept, analyze, and stop a wide range of Internet intruders and hackers. gateway In the wireless world, a gateway is an access point with additional software capabilities such as providing NAT and DHCP. Gateways may also provide VPN support, roaming, firewalls, various levels of security, and so on. hotspot A location where users can access the Internet using Wi-Fi laptops and other Wi-Fi enabled devices. Access may be provided free or for a fee. Hotspots are often found at coffee shops, hotels, airport lounges, train stations, convention centers, gas stations, truck stops, and other public meeting areas. Corporations and campuses often offer hotspot service to visitors and guests. Hotspot service is sometimes available aboard planes, trains, and boats. hub A multiport device used to connect client devices to a wired Ethernet network. Hubs can have numerous ports and can transmit data at speeds ranging from 10 to 1000 Mbps to all the connected ports. A small wired hub may only connect 4 computers; a large hub can connect 48 or more. See router. IEEE 802.11 The family of specifications developed by the Institute of Electrical and Electronics Engineers (IEEE) 802.11 committee, which establishes standards for wireless Ethernet networks. 802.11 standards define the over-the-air interface between wireless clients and a base station, or an access point that is physically connected to the wired network. IP Internet Protocol. The basic communications protocol of the Internet. See IP address, TCP/IP. IP address Internet Protocol address. IP Version 4, the most widely used Internet protocol, provides a 32-bit number that identifies the sender or receiver of information sent across the Internet. An IP address has two parts: The identifier of the particular network on the Internet and the identifier of the particular device (which can be a server or a workstation) within that network. The newer IP, Version 6, provides a 128-bit addressing scheme to support a much greater number of IP addresses. See DHCP, DNS, IP. IP subnet An IP subnet is a local network as defined by IP network numbers. Connecting to a subnet involves connecting to the appropriate hardware network and configuring IP for that network.68 Glossary LAN Local area network. A system of connecting PCs and other devices within the same physical proximity for sharing resources such as an Internet connections, printers, files, and drives. When Wi-Fi is used to connect the devices, the system is known as a wireless LAN or WLAN. See WAN. MAC address Media Access Control address. A unique hardware number that identifies each device on a network. A device can be a computer, printer, and so on. A MAC address is also known as an AirPort ID. Mbps Megabits per second. A measurement of data speed equivalent to a million bits per second. MIMO Multiple-input multiple-output. An advanced signal processing technology that uses multiple receivers and multiple transmitters in both the client and access point to achieve data throughput speeds of 100 Mbps. See 802.11n. NAT Network Address Translation. A network capability that enables multiple computers to dynamically share a single incoming IP address from a dial-up, cable, or DSL connection. NAT takes a single incoming public IP address and translates it to a new private IP address for each client on the network. See DHCP, IP address. network name A name used to identify a wireless network. See SSID. NIC Network interface card. A wireless or wired PC adapter card that allows the client computer to utilize network resources. Most office-wired NICs operate at 100 Mbps. Wireless NICs operate at data rates defined by 802.11 standards. packet A unit of information transmitted from one device to another on a network. A packet typically contains a header with addressing information, data, and a checksum mechanism to ensure data integrity. pass phrase A series of characters used to create a key that is used by Wi-Fi Protected Access (WPA). See PSK, WPA. print server A network device, often a computer, that connects to at least one printer, allowing it to be shared among computers on a network. PSK Pre-shared key. A mechanism in Wi-Fi Protected Access (WPA)-Personal that allows the use of manually entered keys or passwords to initiate WPA security. The PSK is entered on the access point or home wireless gateway and each PC that is on the Wi-Fi network. After entering the password, Wi-Fi Protected Access automatically takes over. It keeps out eavesdroppers and other unauthorized users by requiring all devices to have the matching password. The password also initiates the encryption process which, in WPA is Temporal Key Integrity Protocol (TKIP) and in WPA2 is Advanced Encryption Standard (AES). See TKIP, WPA-Personal, WPA2-Personal.Glossary 69 roaming (Wi-Fi) The ability to move from one area of Wi-Fi coverage to another with no loss in connectivity (hand-off). router A wireless router is a device that accepts connections from wireless devices to a network, includes a network firewall for security, and provides local network addresses. See hub. server A computer that provides resources or services to other computers and devices on a network. Types of servers include print servers, Internet servers, mail servers, and DHCP servers. A server can also be combined with a hub or router. See DHCP, hub, router. SSID Service set identifier. A unique 32-character network name, or identifier, that differentiates one wireless LAN from another. All access points and clients attempting to connect to a specific WLAN must use the same SSID. The SSID can be any alphanumeric entry up to a maximum of 32 characters. See network name. subnet An IP address range that is part of a larger address range. Subnets are used to subdivide a network address of a larger network into smaller networks. Subnets connect to other networks through a router. Each individual wireless LAN will typically use the same subnet for all of its clients. See IP address, router. TCP Transmission Control Protocol. The transport-level protocol used with the Internet Protocol (IP) to route data across the Internet. See IP, TCP/IP. TCP/IP The underlying technology of Internet communications. While IP handles the actual delivery of data, TCP tracks the data packets to efficiently route a message through the Internet. Every computer in a TCP/IP network has its own IP address that is either dynamically assigned at startup (see DHCP) or permanently assigned as a static address. All TCP/IP messages contain the address of the destination network, as well as the address of the destination station. This enables TCP/IP messages to be transmitted to multiple networks (subnets) within an organization or worldwide. For example, when a user downloads a webpage, TCP divides the page file on the web server into packets, numbers the packets, and forwards them individually to the user’s IP address. The packets may be routed along different paths before reaching the user’s address. At the destination, TCP reassembles the individual packets, waiting until they have all arrived to present them as a single file. See IP, IP address, packet, TCP. throughput Usually measured in bps, Kbps, Mbps or Gbps, throughput is the amount of data that can be sent from one location to another in a specific amount of time. See bps, Mbps. USB Universal Serial Bus. A high-speed bidirectional serial connection used to transfer data between a computer and peripherals such as digital cameras and memory cards. 70 Glossary WEP Wired equivalent privacy. The original security standard used in wireless networks to encrypt the wireless network traffic. See WPA, Wireless local area network. Wi-Fi A term developed by the Wi-Fi Alliance to describe wireless local area network (WLAN) products that are based on the Institute of Electrical and Electronics Engineers. Wi-Fi Certified The certification standard designating IEEE 802.11-based wireless local area network (WLAN) products that have passed interoperability testing requirements developed and governed by the Wi-Fi Alliance. wireless network Devices connected to a network using a centralized wireless access point. See WLAN. WLAN A data communications network that spans large local, regional, national, or international areas and is usually provided by a public carrier (such as a telephone company or service provider).The term is used to distinguish between phone-based data networks and Wi-Fi networks. Phone networks are considered wide area networks (WANs) and Wi-Fi networks are considered wireless local area networks (WLANs). See LAN. WPA - Enterprise Wi-Fi Protected Access-Enterprise. A wireless security method that provides strong data protection for multiple users and large managed networks. It uses the 802.1X authentication framework with TKIP encryption and prevents unauthorized network access by verifying network users through an authentication server. See 802.1X. WPA - Personal Wi-Fi Protected Access-Personal. A wireless security method that provides strong data protection and prevents unauthorized network access for small networks. It uses TKIP encryption and protects against unauthorized network access. WPA2 Wi-Fi Protected Access 2. The follow-on security method to WPA for wireless networks that provides stronger data protection and network access control. It provides enterprise and consumer Wi-Fi users with a high level of assurance that only authorized users can access their wireless networks. Based on the ratified IEEE 802.11i standard, WPA2 provides government grade security by implementing the National Institute of Standards and Technology (NIST) FIPS 140-2 compliant AES encryption algorithm and 802.1X-based authentication. There are two versions of WPA2: WPA2- Personal and WPA2-Enterprise. WPA2-Personal protects unauthorized network access by utilizing a set-up password. WPA2-Enterprise verifies network users through a server. WPA2 is backward compatible with WPA. Like WPA, WPA2 uses the 802.1X/EAP framework as part of the infrastructure that ensures centralized mutual authentication and dynamic key management and offers a pre-shared key for use in home and small office environments. Like WPA, WPA2 is designed to secure all versions of 802.11 devices, including 802.11b, 802.11a, and 802.11g, multiband and multimode. See WPA2- Enterprise, WPA2-Personal.Glossary 71 WPA2 - Enterprise Wi-Fi Protected Access 2 - Enterprise. The follow-on wireless security method to WPA that provides stronger data protection for multiple users and large managed networks. It prevents unauthorized network access by verifying network users through an authentication server. See WPA2. WPA2 - Personal Wi-Fi Protected Access 2 - Personal. The follow-on wireless security method to WPA that provides stronger data protection and prevents unauthorized network access for small networks. See WPA2, PSK.www.apple.com/airportextreme www.apple.com/airport © 2009 Apple Inc. All rights reserved. Apple, the Apple logo, AirPort, AirPort Extreme, AppleShare, AppleTalk, Back to My Mac, Bonjour, Mac, and Mac OS are trademarks of Apple Inc., registered in the U.S. and other countries. AirPort Express, AirTunes, Time Capsule, and Time Machine are trademarks of Apple Inc. Other product and company names mentioned herein may be trademarks of their respective companies. 019-1257 Time Capsule3  5 1 7 Time Capsule 8  AirPort  9  11 Time Capsule 13 2 Time Capsule 14 Time Capsule  17  AirPort  19  19  ! Internet " 21 #$%& 22 '()*+,-./0"12 23 3Time Capsule 4 Time Machine 25 3 25 5627"1 Internet 25 56289-.:Time Capsule -. 26 56Time Capsule ;<=> 27 56Time Capsule  ?@ABC4 28 56DEF;<=> 29 G AirPort  29 HITime Capsule JKLM 30 NO AirPort PQR& 31 4 33 Time Capsule 36 Regulatory Compliance Information1 5 1  Time Capsule Time Capsule Time Capsule 0S2TUL#V Wi-Fi WXYZ[\❡ Mac OS X v10.5.2 Leopard :^4_`a Time Machine >❝0^TcLd4 eZ[ 4e 23 ? ➋A Time Capsule 5 Time Machine➌❡  Ÿ-. ¡¢£"1 Internet❝Sžfg Wi-Fi Z ⑧5 iPhone❞iPod touch  Apple TV⑨kl ! Internet "❡2¤0^3"1h fg¥¦ !§¨❡  <-. ¡:;<-. ¡©ª❝«¬d­< Internet "®¯ z{°±K ⑧ˆ5fg❞iPhone❞iPod touch  Apple TV⑨❡  d Time Capsule "1h2›œ❡pZtu Macintosh❞ Windows XP : Windows Vista fg™š1❝/u"1s‚❡  d²³ USB DEF"1h2 Time Capsule❡AirPort 4e<“”fg ⑧<:⑨´u"1hµDEF#V¶D❡  d·1 USB ¸¹"1h2 Time Capsule 4❡AirPort 4e<“”fg ⑧<:⑨´uº»¸¹¼½¾❡ 1  7  d USB ¿À"1h Time Capsule 4❝ÁÂÃ"1Ă USB Z ⑧5DEF: ¸¹⑨❡4e / ➝§¨I¼❤56n Windows XP : Windows Vista fg❝FnB [ J ] > [ e< ] > AirPort ¼❡ -./01( Time Capsule ÷ðZKL❝'()*"1❡ý: ;< 22 ì➋'()*+,-./0"12 ➌❡ /2 13 2  Time Capsule Time Capsule Internet AirPort `Mdz{ê¶N\OP✐dTime Capsule "1 Internet❝^ ➜AirPort ➝¼QR2 Time Capsule žtu❡5G Ä“½Q❝^ ➜AirPort ➝#$tu“½Q❝ý:; www.apple.com/tw/support/airport S4 ➜ AirPort T AirPort  ⑧Mac OS X v10.5 + Windows⑨➝❡ 32ç±q Time Capsule ãä¥å¹4 ➜AirPort ➝¥Â❝2K0^  ➜AirPort ➝¼QRUVVoWpK\ X❡íî#$%&❝ý3 ➜AirPort ➝ ➜wLx➝%ia%D ➜þY➝❡ý:;< 21 ì ➋#$%&➌❡14  2  Time Capsule Time Capsule ~2 Time Capsule z{ Internet "l❝ê¶fgZdu"1  AirPort  !§¨❞YZ[❝^ Internet > ⑧ˆ5\ ]Àf^_`>⑨✐  pZ ➜AirPort ø➝ ➜AirPort Extreme ø➝ Macintosh fg  pZ 802.11a❞802.11b❞802.11g  IEEE 802.11n draft ñòtufg  ž Wi-Fi Z ›œ"1 Time Capsule fgm0º» !§¨^"1 Internet❡ í2ç±q Mac OS X v10.5.2 :^4_`❝2K0^Time Machine d4 e / ➝§¨ I¼❤^Windows fg [ J ] > [ e< ] > AirPort ¼⑨❝%D2 Time Capsule❝ÁÂ×jê ➜e*➝❡ 4 èéfg4 +h❡ 5 Mac OS X v10.5 6789:;<✐ 1 ý%D ➜i6➝ > ➜j♠➝❝ÁÂ×jê ➜¶DÊl➝❡ 2 ×jê ➜Ž,➝⑧+⑨❝ÁÂ3¶E¼%D2DEF❡ 3 ×jê ➜Ž,➝×Ø❡ 56¶Ea;<á DEF❝ý¶4×ØmnDEF❡ 5 Mac OS X v10.3 ,10.4 6789:;<✐ 1 c ➜DEF➝⑧B ➜> / ➝§¨Io⑨❡ 2 %D¶EaDEF❡ 56¶Ea;<á DEF❝ý×jê ➜Ž,➝£A%ia%D Bonjour❝ Á¶Ea%DDEF❡ =>Windows XP , Vista 679:;<✐ 1 ý Time Capsule ãäå¹4ç± Windows _` Bonjour❡ 2 ýèéfg4 +h"1h2DEF❡  AirPort fg:ž“”ø:p1øfg❝d0™š Time Capsule "1 Internet❡"1h Time Capsule ›œËfgm0º»" 1 Internet❡ 2  Time Capsule 17 ™š Time Capsule❝fg"1h›œËfgmu“q#VPQ❡ AirPort íî£pK2 Time Capsule❝ý ➜AirPort ➝¼QR ❡➜AirPort ➝€32ç± Time Capsule å¹4lj"ç±❡ 5 Mac OS X v10.4 ,8?@ Macintosh 678✐ 1 c ➜AirPort ➝⑧B ➜> / ➝§¨Io⑨❡ 2 %D2 Time Capsule ÁÂ×jê [ e*]❡ 56; [ e< ] > AirPort⑨❡ 2 %D2 Time Capsule ÁÂ×jê [ e*]❡18  2  Time Capsule 3 ýèéfg4 +h Time Capsule 2❡ ➜AirPort ➝¼QR€vÝ2jƓÝÞ❝wxî y‹2îz{❝£€|R2+,ö❡ 562î Time Capsule "1 Internet❝2óô} Internet z{{>~ ⑧ISP⑨ý—} ⑧DSL :ÎÏÐF⑨€ ❝:n™šÑ<›œ"1 Internet❡í2 ISP 1h‚½Q ⑧5ƒ IP B„: DHCP )* ID⑨❝0 uî3 ➜AirPort ➝a+,ÅƽQ❡32 Time Capsule l❝ý9 êÅƽQ^Zd❡ 2  Time Capsule 19 20^ ➜AirPort ➝¼QR❡Q Rd…†2UVóô‡ˆ'‰Š❞-. ¡❝ž&â ❡ í2î34 ! USB DEF: USB ¸¹✐ 1 dDEF:¸¹"1h Time Capsule  USB Ë ⑧d⑨❡ 2 c ➜AirPort ➝⑧B Macintosh fg4 ➜> / ➝§ ¨I¼❤:Windows XP fg [ J ] > [ e< ] > AirPort ¼⑨❡ 3 %D2 Time Capsule ÁÂ×jê [ e*]❡ 56; / ➝§¨ I¼❤56nWindows XP fg❝FnB [ J ] > [ e< ] > AirPort ¼⑨❡ 2 %D2 Time Capsule ÁÂ×jê [ e*]❡ í2%3G÷ Time Capsule❝20uî"1÷❝Á ÂÃG Time Capsule ❡ íî3 Macintosh fg4%D2îG❝ý%i¶a AirPort %i❡3Windows XP fg4❝dŽ ï3"‘ 4❝ $h2r’Š“ (SSID) '(❝í”iaÑĂ❝ý%D2❡ 3 ýèéfg4 +h ! Time Capsule  Internet "❡ ➜AirPort ➝z{Tc Time Capsule à7❡562î ž%&❝5¯•"❝:n#$ DHCP %&❝ý ➜AirPort ➝ ➜wLx➝%ia%D ➜þY➝❡ 2  Time Capsule 21 í2î#$ Time Capsule %& ⑧5#$çW%&❞–—❞DHCP ˜ ™l¦❞"®¯•❞fûü❞3€ ^ž⑨❝ý ➜AirPort ➝þY Time Capsule❡ 9F"G✐ 1 c ➜AirPort ➝⑧B Macintosh fg4 ➜> / ➝§ ¨I¼❤^Windows XP fg [ J ] > [ e< ] > AirPort ¼⑨❡ 2 í¶EaÑĂZ❝ý%D2îZ❡56;❝20^Z[fg4e<& â❝w¬2é­❞®¯❞°­±`❡32dTime Machine r#Â❝€ ªXYZ[2fg❡ 562n Mac OS X v10.5.2 :^4_`❝~2²H"1 Time Capsule l❝Time Machine €vÝ2n³îZ[2§¨❡ý×jê ➜\'Z[´¹➝❝ ÁÂTime Machine €XYr#µêY\❡  Mac OS X Leopard ➜j➝ Time Machine ÈCXYZ[❞ ¶j‚Z[´¹❝:nsž❡ 5 Mac OS X Leopard 678,VWTime Machine✐ 1 ý%D ➜i6➝ > ➜j♠➝❝ÁÂ×jêTime Machine❡ 2 dh ➜➝❡ 3 ×jê ➜G´¹➝❡ 4 %D2 Time Capsule £×jê ➜Z[➝❡24  2  Time Capsule ·Z[½¾I¸❝2 ➜Mac QR+h➝❝ÁÂ3mnÆBa+, Time Machine❡3 25 3 XYZ[\]^ Time Capsule Internet  ý£G$12fg"1 Internet❡5627"1❝ý&2n%& ❡56%&❝Ǥn7"1❝ýÈÉ2 Internet  z{{>~ ⑧ISP⑨❡  ý&2"1n%&❡ Time Capsule 20^ÖK Time Capsule ”Ÿ AirPort -.: Time Capsule -.❡ _` Time Capsule PQ✐ 1 ÊËÌ ⑧ˆ58^Í⑨×ÎÖK×Øj ❡ 7k lmnolpqrst❝u+,Y vwx❡26  3  2 %D2 AirPort ❡  5 Macintosh 678❝%i¶a AirPort %i%D Time Capsule  ⑧Š“€Ï⑨❡  5Windows XP ab678❝dŽ ï3"‘ 4❝$h2 r’ [AirPort Š“ ] (SSID) '(❝í”iaÑĂ❝ý%D2 AirPort ❡ 3 c ➜AirPort ➝⑧B Macintosh fg4 ➜> / ➝§ ¨I¼❤^Windows XP fg [ J ] > [ e< ] > AirPort ¼⑨❡ 4 %D2 Time Capsule❝£ ➜wLx➝%ia%D ➜þY➝❡ 5 ׶a AirPort jê❝ÁÂ×jê ➜wLx➝❡ 6 +, Time Capsule -.❡ 7 ×jê ➜➝£ ➜çWЛ➝A%ia%DŽ-àŽ- tu❝£–'2 AirPort Y-. ¡❡íqŽ-tu❝ý+, AirPort -.❡ 8 × ➜G➝jêÖY Time Capsule❝£–Ñ,❡ Time Capsule GÒd AirPort Extreme fÓÂ❝ÃÖd=❡ í Time Capsule rW(=>❝20uîdwLxÖK'ÔÕÖ❡ / Time Capsule noyz{|Y}~v€‚Vƒ„Y ❝… v/ Time Capsule noyz{|Y}❡ 3  27 c Time Capsule defghi✐ m ÊËÌ⑧ˆ58^Í⑨×ÎÖK×Ø❝$h „?@'(⑧™ 5 ⑨❡ Time Capsule d€^ê¶ÖK✐  Time Capsule € DHCP 1 IP B„❡  Š“d€ÖK# ➜Apple Network XXXXXX➝⑧a XXXXXX €^ AirPort ID a Â×.».⑨❡  Time Capsule -.€ÖK# public❡ k Time Capsule lmnopq❝rst;uv✐ 1 ÓØ Time Capsule f❡ 2 ~2, Time Capsule l❝ýÊËÌ×ÎÖK×Ø❡ Time Capsule 0un›œ;<1❝Time Capsule ¡ AirPort PQÙÚ❝:n Internet z{{>~ ⑧ISP⑨ÛÕ45qÝÞ❡562n DSL :ÎÏÐ F"1 Internet❝m0unÏÐF: Internet ¥¦"÷6aÜ❡œ ÏÐFr"?\%@❝mý£GaÜÏÐFf❝¤ÝÞ ¥ÂÃÖ" 1❡3Ö14ÏÐFf¥ß❝ý& Time Capsule n™š›œ$1 "1hÏÐF4❡28  3  5GÄ ?@89“½Q❝ýc ➜AirPort ➝❝%D2 Time Capsule❝Á ➜wLx➝%ia%D ➜þY➝❡×jê ➜wLx ➝á ?@“½Q❡ 2m0^3 AirPort j¼%D ➜·wLxn³<ÝÞ➝❡56wLx4 5ÝÞ❝➜AirPort ➝€❝£|R2ÙÚÝÞ❡ í2÷dDEF"1h Time Capsule 4 USB Ë❝Çn AirPort 4fg7 #V¶D❝ýUV궇ˆ✐ 1 &÷14£÷DEF❡ 2 &1÷ßß14DEF Time Capsule 4 USB Ë❡ 3 &÷3)*fg4 ➜DEF¶E➝·à¼%DDEF❡ 5 Mac OS X v10.5 ,8?@ Macintosh 678✐  ý%D ➜i6➝ > ➜j♠➝❝ÁÂ×jê ➜¶DÊl➝❡  ×jê ➜Ž,➝⑧+⑨£%D¶EaDEF❝ÁÂ×jê ➜Ž,➝⑧+⑨❡ 5 Mac OS X v10.2.7 ,8?@ Macintosh 678✐  c ➜DEF➝⑧B ➜> / ➝§¨Io⑨❡  íDEF3¶E¥o❝ý× ➜Ž,➝jê❡  A%ia%D Bonjour❝%DDEF❝ÁÂ×jê ➜Ž,➝⑧+⑨❡ 3  29 5Windows XP 678✐   [ J ] tuEac [ ¶DÊl ]❡  %DDEF❡í”ia2ÑDEF❝× [ áDEF ] jê❝ÁÂèéfg4 +h #V❡ 4 —DEF❝¤ÝÞ ¥ÂÃÖYDEF❡ AirPort Apple €ªz{G AirPort ❡â2G Time Capsule  ❡ 20^3 AirPort j¼%D ➜~c AirPort lãäG&â➝: ➜ãäG&â➝❡562å% ➜ãäG&â➝❝ý3A%i¼%Dj‚ æªl¦ ⑧ˆ5¼æ⑨❝«¬XYãäG&â❡ Time Capsule ê¶âR&0|R2 Time Capsule çhPQÙڐ‘è éêÙÚ❡  d2 Time Capsule KëìÌ ⑧5í:îï⑨‰ðJñe❡òIî SóôõöEÈ❡  í2d Time Capsule KíÂà❝ýS Time Capsule íÕ÷¥¦ )ú ð 2.5 øW ⑧1 ùú⑨ûü❡  ýþd2 Time Capsule JK3<ÒÈ^4õöÈñe❡30  3   í2d Time Capsule K¬®Z¯a❝>ýþ Time Capsule  Ò®❞·Q:f❡d21¿aJK Time Capsule j ❡ 0uS Time Capsule 1¥¦ÕV ¦❡  ± Time Capsule BK❝>ûü ❞2.4 : 5 gigahertz ⑧GHz⑨f ^žNOð 7.6 ø ⑧25 ù⑨❡  ýdžÌ` ⑧❞❞ ̤⑨J3Time Capsule 4È❡Ž€N OTime Capsule ❡ AirPort ûüNO❝uð#ÝÞ0u•❡ ê¶&â0u€NO AirPort PQ✐   $z{ ⑧DSS⑨f}  !Æy‹¹‹¨eãäk"fÎ❡ýZ#~ÈÉ^»b‹ fÎ❡  !Æf$%❝ˆ5f❞f&è'()^4fÔ¤   2.4 : 5 GHz }*f❡562f: AirPort PQ45ÝÞ❝ý GwLx: Time Capsule e})❝:Gfe})❡  “ôwLx“+})❡ˆ5❝56wLx A '}) 1❝wLx B K>'}) 6 :}) 11❡4 31 4 wxyz❞|}~€ Time Capsule 5 Time Capsule “½Q❝ýß, www.apple.com/tw/airport S❡ íî-. Time Capsule⑧56~²23ç± Time Capsule å¹4l£2- .⑨❝ýß, www.apple.com/tw/register S❡ 5 AirPort ²³½Q❞‚/0½Q3/’12Ó❝^ Apple  êÑ❝ýß, www.apple.com/tw/support/airport S❡ 534^·²³z{❝ýß, www.apple.com/tw/support S❝£%D2 4¢:LÓ❡32  4  íî7ÙGÄ3 Time Capsule 4 ➜AirPort ➝“½Q❝ýc ➜AirPort ➝£%D ➜QR+h➝ > ➜AirPort QR+h➝❡ í2 Time Capsule Û567:n7%@?\❝ýèé`þ.a+h ❞ fgQR+h4½ü❡ í Time Capsule 8Á7,9?\❝ýß, www.apple.com/tw/support S^7 Ù5»b ƒz{½Q❡ Time Capsule 2 Time Capsule :oD<- ❡33 Time Capsule ‚ƒ„~C… †‡ Time Capsule  ˆ‰Š‹✐2.4  5 GHz  LŒMf3‹✐ƒ 23 dBm ⑧;⑨  Ž✐802.11 DSSS 1  2 Mbps ïð❝802.11a❞802.11b❞802.11g ñò draft 802.11n ñò  1 RJ-45 10/100/1000Base-T Gigabit ›œ WAN ⑧<⑨  3 RJ-45 10/100/1000Base-T Gigabit ›œ LAN ⑧G⑨  P-¶<=> ⑧USB d⑨ 2.0  802.11 a/b/g/n AirPort Extreme   v‘✐0° C ú 35° C ⑧32° F ú 95° F⑨  ’“‘✐–25° C ú 60° C ⑧–13° F ú 140° F⑨  ”•–‘ ⑧v—⑨✐20% ú 80%  ”•–‘ ⑧’“—⑨✐10% ú 90%❝?@A 34 ˜ Time Capsule  ™‘✐197.0 øB ⑧7.75 ùú⑨  š‘✐197.0 øB ⑧7.75 ùú⑨  ›‘✐36.33 øB ⑧1.43 ùú⑨  _œ✐1.6 øC ⑧3.5 ùD⑨ MAC Time Capsule :oD<҂¸B„✐  AirPort ID✐Ł‚B„nEF4 Time Capsule❡  žNO ID✐íîd Time Capsule "1 Internet❝20uîz{µB„½Q° 2 ISP❡ Time Capsule  d Time Capsule frW—Gjà7naÜf❡  ~"1:ÓØ Time Capsule l❝ý{óHÎI❡îSþ óôI õöo[❡  2n89❝œn Time Capsule ;<14f❝´0^dJÙ❡í 2 Time Capsule îz{❝ý:;< 31 ì ➋GÄ+h❞z{²³➌❡  ý Vd1I,Ê+Ëa❡í27^öü%$d1I,Ê+Ëa❝ ÛK«ñò0u£“õ❡ý&21IÊ+ËL¬“õ❝–2nd 1I, >Ê+Ëa❡˜ Time Capsule 35  ~2 Time Capsule l❝·MN Oƒn%@ÑP❡Time Capsule ·M <t❝uʆooQ`N❝4ú·o‰R &a❡  S Time Capsule üS❝5T¾❞UV❞WX❞YW¦¤ñe❡  ý ¡ Time Capsule❝ýþŸhZå$[❝£–ýþ9\]:ž9^¸Ÿ _❡  ý îS`Ì:Sab32 Time Capsule 4❡í454PcË❝ ýӟfÔüabS❡  ýî3d· Time Capsule❡Time Capsule nTdo/0❡ 3KJ:¿elíü~❝0u€ Time Capsule #6f❡~23?Œš a❝ý îgh Time Capsule❡ !†‡ˆ0‰Š‹ŒŽ❝(A‘’“”•–ƒ  Time Capsule❡ (—˜™š  Time Capsule ›œ/žŸ❡7a/Œˆ0 ¡… ¢„£¤¥¦§x¨❡AirPort Express ©ª…^«h¬­®¯°❡36 Regulatory Compliance Information Wireless Radio Use This device is restricted to indoor use due to its operation in the 5.15 to 5.25 GHz frequency range to reduce the potential for harmful interference to cochannel Mobile Satellite systems. Cet appareil doit être utilisé à l’intérieur. Exposure to Radio Frequency Energy The radiated output power of this device is well below the FCC and EU radio frequency exposure limits. However, this device should be operated with a minimum distance of at least 20 cm between its antennas and a person’s body and the antennas used with this transmitter must not be colocated or operated in conjunction with any other antenna or transmitter subject to the conditions of the FCC Grant. FCC Declaration of Conformity This device complies with part 15 of the FCC rules. Operation is subject to the following two conditions: (1) This device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. See instructions if interference to radio or television reception is suspected. Radio and Television Interference This computer equipment generates, uses, and can radiate radio-frequency energy. If it is not installed and used properly—that is, in strict accordance with Apple’s instructions—it may cause interference with radio and television reception. This equipment has been tested and found to comply with the limits for a Class B digital device in accordance with the specifications in Part 15 of FCC rules. These specifications are designed to provide reasonable protection against such interference in a residential installation. However, there is no guarantee that interference will not occur in a particular installation. You can determine whether your computer system is causing interference by turning it off. If the interference stops, it was probably caused by the computer or one of the peripheral devices. If your computer system does cause interference to radio or television reception, try to correct the interference by using one or more of the following measures:  Turn the television or radio antenna until the interference stops.  Move the computer to one side or the other of the television or radio.  Move the computer farther away from the television or radio.  Plug the computer into an outlet that is on a different circuit from the television or radio. (That is, make certain the computer and the television or radio are on circuits controlled by different circuit breakers or fuses.) If necessary, consult an Apple Authorized Service Provider or Apple. See the service and support information that came with your Apple product. Or, consult an experienced radio/television technician for additional suggestions. Important: Changes or modifications to this product not authorized by Apple Inc. could void the EMC compliance and negate your authority to operate the product.37 This product was tested for FCC compliance under conditions that included the use of Apple peripheral devices and Apple shielded cables and connectors between system components. It is important that you use Apple peripheral devices and shielded cables and connectors between system components to reduce the possibility of causing interference to radios, television sets, and other electronic devices. You can obtain Apple peripheral devices and the proper shielded cables and connectors through an Apple-authorized dealer. For non-Apple peripheral devices, contact the manufacturer or dealer for assistance. Responsible party (contact for FCC matters only) Apple Inc., Corporate Compliance, 1 Infinite Loop M/S 26-A, Cupertino, CA 95014-2084 Industry Canada Statement This Class B device meets all requirements of the Canadian interference-causing equipment regulations. Cet appareil numérique de la Class B respecte toutes les exigences du Règlement sur le matériel brouilleur du Canada. VCCI Class B Statement Europe—EU Declaration of Conformity For more information, see www.apple.com/euro/ compliance. European Union — Disposal Information This symbol means that according to local laws and regulations your product should be disposed of separately from household waste. When this product reaches its end of life, take it to a collection point designated by local authorities. Some collection points accept products for free. The separate collection and recycling of your product at the time of disposal will help conserve natural resources and ensure that it is recycled in a manner that protects human health and the environment. Disposal and Recycling Information This product has an internal battery. Please dispose of it according to your local environmental laws and guidelines. For information about Apple’s recycling program, go to www.apple.com/environment. California: The coin cell battery in your product contains perchlorates. Special handling and disposal may apply. Refer to www.dtsc.ca.gov/hazardouswaste/ perchlorate. Deutschland: Dieses Gerät enthält Batterien. Bitte nicht in den Hausmüll werfen. Entsorgen Sie dieses Gerätes am Ende seines Lebenszyklus entsprechend der maßgeblichen gesetzlichen Regelungen. Nederlands: Gebruikte batterijen kunnen worden ingeleverd bij de chemokar of in een speciale batterijcontainer voor klein chemisch afval (kca) worden gedeponeerd.38 Ÿ ✐ Singapore Wireless Certification Taiwan Warning Statements Korea Warning Statements © 2009 Apple Inc.  j®9❡ Apple❞i6❞Apple ïi❞AirPort❞AirPort Express❞ AirPort Extreme❞Apple TV❞Bonjour❞iPod❞ Leopard❞Macintosh❞Mac OS Time Capsule n Apple Inc. 334ž4¢LÓ-.~ï❡ Finder❞iPhone  Time Machine n Apple Inc. ~ï❡ ¬zžøj/0Š“0u'eöøj ~ï❡www.apple.com/airport www.apple.com/support/airport TA019-1384-A Time Capsule3  5 1 7  Time Capsule 8  AirPort  9  11 Time Capsule  13 2 Time Capsule 14  Time Capsule  17  AirPort  19  19  !"# Internet $% 21 &'()*+ 22 ,-./0123456$%7 23 8 Time Capsule  Time Machine 25 3 25 9:;<= Internet 25 >?34@ Time Capsule 34 26 Time Capsule ABCD 27 Time Capsule  EFGHIJK4 28 LMNABCD 29 O AirPort  29 P Time Capsule QRS+ 30 TU AirPort VWXY&Z 31 4 33 Time Capsule 36 Regulatory Compliance Information1 5 1  Time Capsule  Time Capsule  Wi-Fi [\]Z^_`ab❞d Mac OS X v10.5.2 Leopard @O(efg Time Machine DhijklmnopBqrs\]Z^ t Time Capsule o❞ Time Capsule uvw[x: AirPort Extreme yzj{|}~€‚❞ & ƒ Time Capsule „j…T†(‡ Wi-Fi ˆ   2.4 ‰Š‹ (GHz) j 802.11b❝ 802.11g ! 802.11n &Zj iPhone❝ iPod touch !Žqr   5 GHz j 802.11n ! 802.11a &Zjqr! Apple TV &ZT:‘’{|“”•:–—˜•j™š Time Capsule T› oqr!&Z"#œ Internet ;<❞6  1 Bž Time Capsulej76Ÿˆ  d Mac OS X v10.5.2 @O(ef¡g Time Machine DhiZ^ opBqrŸ–Ÿ¢;? Time Capsule  Time Machine@❞  £34¤¥¦j§„;? Mac OS X Leopard D Time Machine  Time Capsule  Mac OS X v10.5.2 aST❞  Macintosh  Time Capsule  wäåB AirPort @ AirPort Extreme ù Macintosh qrjŸ°& …µ¶ ;<ú@wŸ¢q´;❞7â ã? @Ab dâAirPort ãâAirPort & ãây zãÈBg¡g*4âC]üJKãjD TF I JKj+C]'=❞ &()*10*-. 6:Edí]%2❞ Time Capsule EFí]¨GHIJ❞12  1 E Time Capsule q„j âAirPort ã& …jŸ› Internet ;<❝USB LMN❝ USB ¼½@ÒB8❞d¶ Mac OS X q rojâAirPort ãËâDhiã¬Kâã¬Kgú™ d¶ Windows XP @ Windows Vista qrojDË âLã> âpBhiã> âAirPortãg❞ &'2* Time Capsule ìïZƒ,-./0$%❞9: ; 22 é â,-./0123456$%7 ã❞ /2 13 2  Time Capsule Time Capsule Internet AirPort fM{|žBE Time Capsule ;âp Bhiã > âAirPortãg¡j*]7 Time Capsulej§„^Ù â_`ã❞ 4 Ùæab ❞ 4 Mac OS X v10.5 56789:; 1 *4cb > âdefƒ& ãj§„^Ù âLM›ghã❞ 2 ^ÙiÙÚ (+) ¨÷+g*]7LMN❞ 3 ^ÙiÙÚ❞ 7LMN9d÷+gjgÙÚjk…❞ 4 Mac OS X v10.3 < 10.4 56789:; 1 LâLMN& ã ËâDhiã¬Kâã¬Kg¡❞ 2 ÷+g*]LMN❞ LMN9d÷+gj^ÙiÙÚ¨?@Abg*4âBonjourãj§„ ÷+g*]LMN❞ =>?9 Windows XP < Windows Vista 567:;@ 1  Time Capsule » CD äå Bonjour  Windows e¡❞ 2 Ùæab ; âpBhiã > âAirPortã❞ 2 *]7 Time Capsulej§„^Ù â_`ã❞18  2 Time Capsule 3 Ùæab & Time Capsule !❞ âAirPort ã& NþEs%7Bátu!á0vU% 2j¨wN728& ❞ 7á Time Capsule ;<= InternetjD1á Internet vUx (ISP) {|œ  DSL ÎÏÐο@´ÎÏÐο¡y/j@ÑÒBŸ¢ < Internet ;<❞7 ISP 3`žz'Á { IP m|@ DHCP . / ID¡j76:1ád âAirPort ãg2}ÁÂ❞à& 7 Time Capsule ü34ºÁÂ❞ 2 Time Capsule 19 76Ÿ âAirPort ã& Nþ❞º& NþT~ 57%W€❝34¤¥–&'’©*+pô1~❞ 7Ld7o"# USB LMN@ USB ¼½ˆ 1 ELMN@¼½;<= Time Capsule  USB 0Ê (d) o❞ 2 LâAirPort ã Macintosh qrˆËâDhiã¬Kâ ã¬Kgú¶ Windows XP qrˆËâLã>âpBhiã>âAirPortã g¡❞ 3 *]7 Time Capsulej§„^Ù â_`ã❞ o9tpá  Time Capsulej^ÙâFqrãŸqr6&Zj §„÷+g*]7 Time Capsule❞ 4 Ùæab ❞ Internet 7L›oB‚x:@;<=Ÿ¢0Êqr"# Internet ; âpBhiã > âAirPortãg¡❞ 2 *]7 Time Capsulej§„^Ù â_`ã❞ áUìƒ& ƒ Time Capsule µ¶O„j76:ô;âpBhiã>âAirPortã g¡❞ 2 ÷+gBÄ&Zj*]7pá &Z❞o9tpá  Time Capsulej^Ù âFqrãŸqr6&Zj§„÷+g*]7  Time Capsule❞ 7áUìƒ& ƒ Time Capsule µ¶O„j76:ô;<=… j…:U Time Capsule µ¶O„❞ á*47páO„jd Macintosh qrobg AirPort b❞däåž Windows XP qrojE †Pd;<‡îoj&t7 ot€ˆ (SSID)j§„÷+g*4  BÄ6¡❞ 3  âyzãbg*4 â]& ã❞{7234jD234❞ B âAirPort ãg]& x:OÄÁÂj9:www.apple.com.cn/ support/airport oâDesigning AirPort Networks Using AirPort Utility (Mac OS X v10.5 + Windows)ã  Airport &Q AirPort  (MacOS X v10.5 + Windows)¡❞22  2 Time Capsule 7 WPA Personal @ WPA/WPA2 Personal µ¶34¤¥jD76Ÿ‘ ./0{|U7$%x:j™91©*234❞ à7,-./0$%7üjº./0€ˆ! MAC m|  @ AirPort ID¡T/E”d âAirPort ã$%Ï÷+gj&t7÷+g •–º./0❞7û6Ÿ{| 24 —ü$%j®ü«³„j./0E9:G$% 7❞ à7,-./0$%7üjº./01234❞ NOPQRSTUVWXYZ[\!5UV 1 LâAirPort ãj*]7 Time Capsulej§„âyzãb*4â ]& ã❞ôáü234❞ 2  âyzãbg*4 âi./0ã❞ 3 *]º./0$%‰Aˆ  *] PIN Ÿ2./0ø$%ü{|˜ËT™❞  *] âšHIJãŸ,-;IJ./0$%❞ à Time Capsule d“›./0üj LED TFœI#$❞ 2 Time Capsule 23 p‘7{|žü«$%j*] âE./0$%‹Ï‘ 24 — üã❞9*]}*+j./0E6Ÿ&$%j&t7÷+g•–º./0❞ Time Capsule Time Machine d Mac OS X Leopard g Time Machine Dhij76ŸZ^qroŸ ˜j ¡7æ¢❝£¤❝¥¢!¬¦❞ & ƒ Time Machine ª„j…T'§\]Z^7qr❞ 7v Mac OS X v10.5.2 @O(efjD;H;Z^©½ãj§ „ Time Machine Tª¶«ç¬>❞  Mac OS X Leopard g âdefƒ& ã âTime MachineãÈB& \ ]Z^❝O„=9}Z^©½@α’©& ❞ A?9 Mac OS X Leopard 567I<]^ Time Machine 1 *4cb > âdefƒ& ãj§„^Ù âTime Machineã❞ 2 E­]= âã❞ 3 ^Ù âO„©½ã❞ 4 *47 Time Capsule ¨^Ù âZ^ã❞24  2 Time Capsule šH Time Capsule ! Time Machine Z^6:1á±®@O¯ü«j4° 7Z^T±IJ❞ᐳLZ^‡jŸ¢E Time Capsule ; âMac wNãj§„djkÄ âTime Machineã❞3 25 3 _`abcde Time Capsule Internet  IJ&<7qr;<= Internet❞79:;âpBhiã>âAirPortã g¡❞ 4 *]7 Time Capsulej§„ âyzãbg*4 â]& ã❞ 5 dg^Ù âAirPortãj§„^Ù âyzã❞ 6 ‘7 Time Capsule 234❞ 7 ^Ùâã¨âä[•ã?@Abg*4ý3‰ŠjŸ°‘ AirPort í3¨ÓC34¤¥❞7Lž3x:j‘7 AirPort 2 34❞ 8 ^Ù âOãŸFí] Time Capsule ¨Ô& ❞ Time Capsule IJÕç„GE…q❞  Time Capsule %[ÂÃCDjD76:1áE’ØËt@Ö& ❞ , Time Capsule ij0vwxyUVsz{|4}RUV~,Qi j0 Time Capsule €CUV❞ 3 27 h Time Capsule ifjkl m ËÌÍÎ  ÏÐÑ¡ÙÒØËÙÚj&t ‡JK  S× 5 ! "¡❞ Time Capsule EØ˨BŸç& ˆ  Time Capsule  DHCP <ؒ IP m|❞  €ˆEØˑ Apple Network XXXXXX ®Ù XXXXXX  AirPort ID “„Ú ËT™ÛÜ¡❞  Time Capsule 34Øˑ public❞ mn!5 Time Capsule opqrstuvwxy 1 E Time Capsule Þq❞ 2 E Time Capsule q}üjËÌÍÎÙÒØËÙÚ❞ Time Capsule Ÿ¢q´6:Ý'(;<❝ Time Capsule 6:9d AirPort ÞßàáŸ@Ñ 7 Internet vUx6:Ed%2❞7 DSL ÎÏÐο@´ÎÏÐο ;<= InternetjDºÎÏÐο6:ìâãž;<@ Internet ;<❞5°Î ÏÐοäå>'=jûIJÞ…qj“›è!"j§„‘ÎÏÐο Fˆ 1 ('LMNìƒq¨ìq❞ 2 ('q´ìƒëìm;<=LMN! Time Capsule  USB 0Êo❞ 3 (¤ìƒd./0qr âLMN÷+ãíÊg*]žºLMN❞ ABCD Mac OS X v10.5 âdefƒ& ãj§„^Ù âLM›ghã❞  ^ÙiÙÚ (+) ¨d÷+g*]7LMNj§„^ÙiÙÚ (+)❞ ABCD Mac OS X v10.2.7 ❞ 4 LMNj“›è!ýj§„Gí…❞ AirPort Apple '§O AirPort ❞î7O Time Capsule Ÿ“❞ 7û6Ÿd AirPort fƒ& g*] âL AirPort üÅÆOãj@*] âÅÆOã❞7*] âÅÆOãjD?@Abg*4ü«ï   â´ð㡟\]ÅÆO❞ Time Capsule ŸçîBN Time Capsule 3`“”²Áàá!Þßàá❞  E Time Capsule P dèåABÜñÍ Sò@óô¡õö÷Íg❞I JE’P døùúû+ÈË ❞  7E Time Capsule P dò„ÈjD Time Capsule !ò×ü«ýD= ²B 25.4 þ  1 ¡❞  E Time Capsule P dÓÈ@Óȟosvúû+È÷Íg❞30  3  ád ¤g gE Time Capsule !0 &ZPd$j£€q ´❝ €q´@q Time Capsule❞P Time Capsule üjq´áPd ❞ Time Capsule !q´ª«á¤¸6:Sõ«❞  IJE Time Capsule P dù❝ 2.4 @ 5 ‰Š‹ (GHz) q!’©X Y=² 7.6   25 ¡Ë ❞  E’©ÍΠf❝@—͓“¡P d Time Capsule ❞®6: T¥C Time Capsule ❞ AirPort ùXY øjVW%26:•ûR —❞ŸçS+TU AirPort ²Á!"XYˆ    &<#$vU (DSS) €’%&  'Ætu()#$žp»*§}+q´❞‚d&Z"!xŸ3`u q´❞  'Æq,&Zj(-q❝q,./0❝qz““  2.4 GHz @ 5 GHz q€’àáŸq❞7q@ AirPort ²ÁE d%2jO„7yz@ Time Capsule €0j@ÑO„7q €0❞  »1B21€0yz❞Սjyz A & ‘€0 1jDyz B Dº& ‘€0 6 @ 11❞4 31 4 DdEz{|❝~1€ Web Time Capsule B Time Capsule “ÁÂj$% www.apple.com.cn/airport❞ áQ3 Time Capsule 7däå Time Capsule CD oüAB®¯4¡j $% www.apple.com/register/cn/❞ B AirPort ·¸ÁÂ❝›z'!ÎmÁÂ!56À7Ÿ–“ Apple  çÔj$% www.apple.com.cn/support/airport❞ B89Ÿ¾·¸ÁÂj$% www.apple.com/supportj§„*47pd9 ò@m÷❞32  4 ážÐB Time Capsule » âAirPort ãOÄÁÂjL âAirPort ã¨*4 âwNã > âAirPort wNã❞  Time Capsule o$ì:;@9:'=>jÙæf3❝abwN!d <g¬>❞  Time Capsule È9:>j$% www.apple.com.cn/support ŸžÐB 3`¤=vUÁÂ❞ Time Capsule i÷ M Time Capsule >❞33 Time Capsule ‚ƒ1B„…† Time Capsule  ‡ˆ2.4 = 5 GHz  S‰TkŠ‹“(6? 23 dBm  îˆ@¡  Œ802.11 DSSS 1 ! 2 Mbps îï❝ 802.11a❝802.11b❝ 802.11g ðñjŸ–òó 802.11n ðñ  1 RJ-45 10/100/1000Base-T ‰ŠËŸ¢ÌÍ (<)  3 RJ-45 10/100/1000Base-T ‰ŠËŸ¢ÔÍ (G)  ²A¶B (USB d) 2.0  802.11 a/b/g/n AirPort Extreme   xyŽ0° C = 35° C  32° F = 95° F¡  ‘Ž–25° C = 60° C  –13° F = 140° F¡  ’“” •xy–—20% = 80% mUC  ’“” •‘–—10% = 90% mUC  DEF¡34 ˜ Time Capsule  ™197.0 þ  7.75 ¡  š197.0 þ  7.75 ¡  F36.33 þ  1.43 ¡  ›œ1.6 ‰G  3.5 H¡ (MAC) Time Capsule d¾I>JMBÓ¼m|ˆ  AirPort ID’g†m|KLo Time Capsule❞  U ID76:1áE}m|{|æ ISP Ÿ°E Time Capsule ; Time Capsule qN‰ŠvE’qoÕç❞  à;<@Þ Time Capsule üjUôOÒP†❞ áøùPúû Q❞  9¹8‘çè78js9DR Time Capsulej5à…ìÞqüû9:R ❞7 Time Capsule 1áS=j9:; 31 é âžÐOÄÁÂ❝vU! ·¸ã❞  9áEj E&ZŸt¾ÈZXõ,g❞   Time Capsule øù[ j\]❝^_¼❝`a❝b`c“❞  ¤¥ Time Capsule 9£dn&‘!ef@’©C,g❞  — 9áEhÍ@[ ijd Time Capsule o❞ìkÍÎjæ… Þqj§„GÉ^ijÍ❞  dc¾ Time Capsule❞ Time Capsule vcŸ!Î❞ E”@¬>9àj6:T:; Time Capsule❞d2 Time Capsule ³hgj— 9áE…–dmo❞ ‚*ƒ„…†‡&ˆ‰Šc‹ŒjV Time Capsule❞ \ Ž‘’ Time Capsule❞ s“”*ƒ~4•–— ˜™š›❞œž4Ÿ '€ ¡—¢L❞36 Regulatory Compliance Information Wireless Radio Use This device is restricted to indoor use due to its operation in the 5.15 to 5.25 GHz frequency range to reduce the potential for harmful interference to cochannel Mobile Satellite systems. Cet appareil doit être utilisé à l’intérieur. Exposure to Radio Frequency Energy The radiated output power of this device is well below the FCC and EU radio frequency exposure limits. However, this device should be operated with a minimum distance of at least 20 cm between its antennas and a person’s body and the antennas used with this transmitter must not be colocated or operated in conjunction with any other antenna or transmitter subject to the conditions of the FCC Grant. FCC Declaration of Conformity This device complies with part 15 of the FCC rules. Operation is subject to the following two conditions: (1) This device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. See instructions if interference to radio or television reception is suspected. Radio and Television Interference This computer equipment generates, uses, and can radiate radio-frequency energy. If it is not installed and used properly—that is, in strict accordance with Apple’s instructions—it may cause interference with radio and television reception. This equipment has been tested and found to comply with the limits for a Class B digital device in accordance with the specifications in Part 15 of FCC rules. These specifications are designed to provide reasonable protection against such interference in a residential installation. However, there is no guarantee that interference will not occur in a particular installation. You can determine whether your computer system is causing interference by turning it off. If the interference stops, it was probably caused by the computer or one of the peripheral devices. If your computer system does cause interference to radio or television reception, try to correct the interference by using one or more of the following measures:  Turn the television or radio antenna until the interference stops.  Move the computer to one side or the other of the television or radio.  Move the computer farther away from the television or radio.  Plug the computer into an outlet that is on a different circuit from the television or radio. (That is, make certain the computer and the television or radio are on circuits controlled by different circuit breakers or fuses.) If necessary, consult an Apple Authorized Service Provider or Apple. See the service and support information that came with your Apple product. Or, consult an experienced radio/television technician for additional suggestions. Important: Changes or modifications to this product not authorized by Apple Inc. could void the EMC compliance and negate your authority to operate the product.37 This product was tested for FCC compliance under conditions that included the use of Apple peripheral devices and Apple shielded cables and connectors between system components. It is important that you use Apple peripheral devices and shielded cables and connectors between system components to reduce the possibility of causing interference to radios, television sets, and other electronic devices. You can obtain Apple peripheral devices and the proper shielded cables and connectors through an Apple-authorized dealer. For non-Apple peripheral devices, contact the manufacturer or dealer for assistance. Responsible party (contact for FCC matters only) Apple Inc., Corporate Compliance, 1 Infinite Loop M/S 26-A, Cupertino, CA 95014-2084 Industry Canada Statement This Class B device meets all requirements of the Canadian interference-causing equipment regulations. Cet appareil numérique de la Class B respecte toutes les exigences du Règlement sur le matériel brouilleur du Canada. VCCI Class B Statement Europe—EU Declaration of Conformity For more information, see www.apple.com/euro/ compliance. European Union — Disposal Information This symbol means that according to local laws and regulations your product should be disposed of separately from household waste. When this product reaches its end of life, take it to a collection point designated by local authorities. Some collection points accept products for free. The separate collection and recycling of your product at the time of disposal will help conserve natural resources and ensure that it is recycled in a manner that protects human health and the environment. žŸ1 ¡{| f!Π-Ÿ q¼❞l±àm¤Šðþ …❞B Apple mØQnÁÂj$% www.apple.com.cn/environment❞ California: The coin cell battery in your product contains perchlorates. Special handling and disposal may apply. Refer to www.dtsc.ca.gov/hazardouswaste/ perchlorate. Deutschland: Dieses Gerät enthält Batterien. Bitte nicht in den Hausmüll werfen. Entsorgen Sie dieses Gerätes am Ende seines Lebenszyklus entsprechend der maßgeblichen gesetzlichen Regelungen. Nederlands: Gebruikte batterijen kunnen worden ingeleverd bij de chemokar of in een speciale batterijcontainer voor klein chemisch afval (kca) worden gedeponeerd.38 Taiwan: Singapore Wireless Certification Taiwan Warning Statements Korea Warning Statements © 2009 Apple Inc. ¤opq❞ Apple❝c❝Apple îr❝AirPort❝ AirPort Express❝ AirPort Extreme❝Apple TV❝Bonjour❝iPod❝Leopard❝ Macintosh❝Mac OS ! Time Capsule v Apple Inc. d8 9–’©9ò!m÷Q3xî❞Finder❝iPhone ! Time Machine v Apple Inc. xî❞ ®Ù{–’©!Î!st€ˆ6:v’mDst xî❞www.apple.com/airport www.apple.com/support/airport CH019-1384-A Time Capsule Setup Guide3 Contents 5 Getting Started 8 About Your Time Capsule 9 About the AirPort Software 10 What You Need to Get Started 12 The Time Capsule Status Light 14 Setting Up Your Time Capsule 15 Using Your Time Capsule to Create Your Wireless Network 18 Using AirPort Utility 20 Creating a New Wireless Network 20 Configuring and Sharing Internet Access 22 Setting Advanced Options 23 Allowing Wireless Clients to Access Your Network Without Entering a Password 24 Using Time Machine with Your Time Capsule 26 Tips and Troubleshooting 26 If You Can’t Connect to the Internet 26 If You Forgot Your Network Password or Time Capsule Password 28 If Your Time Capsule Isn’t Responding 29 If Your Time Capsule Status Light Flashes Amber4 30 If Your Printer Isn’t Responding 31 Updating AirPort Software 31 Time Capsule Placement Considerations 32 Items That Can Cause Interference with AirPort 33 Learning More, Service, and Support 35 Time Capsule Specifications and Safety Guidelines 38 Regulatory Compliance Information1 5 Getting Started Congratulations on purchasing your Time Capsule. Read this guide to get started. Time Capsule offers you the simplicity of fully automated backup for your Wi-Fi network. Using the Time Machine application in Mac OS X v10.5.7 Leopard or later, it’s easy and automatic to back up all the computers on your network to a single Time Capsule. The Time Capsule is also a fully featured AirPort Extreme Base Station that provides simultaneous dual-band wireless networking.When you set up your Time Capsule, it creates two high-speed Wi-Fi networks:  A 2.4 gigahertz (GHz) network for 802.11b, 802.11g, and 802.11n devices, such as iPhone, iPod touch, and older computers  A 5 GHz network for 802.11n and 802.11a devices, such as newer computers, iPad, and Apple TV Wireless devices join the network that provides them the best performance and compatibility, and the Time Capsule shares your broadband Internet connection with computers and devices on your network.6 Chapter 1 Getting Started With your Time Capsule, you can:  Use the Time Machine application in Mac OS X v10.5.7 (or later) to back up all the computers on your wireless network, as well as computers connected to your Time Capsule using Ethernet. Note:  Your first backup with Time Capsule and Time Machine could take overnight or longer, depending on how much data you’re backing up. To speed up the initial backup, use an Ethernet cable to connect your computer to the LAN port on your Time Capsule. For more information about using Time Machine, see “Using Time Machine with Your Time Capsule” on page 24.  Create a password-protected wireless home network, and then connect to the Internet and share the connection with other computers and Wi-Fi devices, such as iPad, iPhone, iPod touch, and Apple TV. You can also share files among computers connected to the network.  Create a guest network, with or without password protection to provide Internet-only access to wireless devices, such as computers, iPad, iPhone, iPod touch, and Apple TV.  Connect your Time Capsule to your Ethernet network.Wireless-equipped Mac, Windows XP, Windows Vista, or Windows 7 computers can then have access to an entire network without being connected by a cable.  Connect a supported USB printer to your Time Capsule. Compatible computers on the AirPort network, both wireless and wired, can print to it.  Connect an additional USB hard drive to your Time Capsule. Compatible computers on the AirPort network, both wireless and wired, can access information on the hard disk.Chapter 1 Getting Started 7  Connect a USB hub to your Time Capsule, and then connect multiple USB devices, such as printers or hard disks. All computers on the network have access to those devices. Important:  Use AirPort Utility to set up your Time Capsule. Previous versions of AirPort Setup Assistant and AirPort Admin Utility are not compatible with this Time Capsule. AirPort Utility is installed in the Utilities folder in the Applications folder on a computer using Mac OS X, and in Start > All Programs > AirPort on a computer using Windows. If AirPort Utility isn’t installed on your computer, you can download it from www.apple.com/support/airport. Apple periodically updates AirPort software. It’s recommended that you update your software to keep your Time Capsule up to date. Note:  To download a copy of this setup guide in your language, open AirPort Utility and choose Help > AirPort Service and Support, and click Manuals.8 Chapter 1 Getting Started About Your Time Capsule Your Time Capsule has five ports on the back:  One 10/100/1000Base-T Gigabit Ethernet Wide Area Network (WAN) port for connecting a DSL or cable modem, or for connecting to an existing Ethernet network  Three 10/100/1000Base-T Gigabit Ethernet Local Area Network (LAN) ports for connecting Ethernet devices, such as printers or computers, or for connecting to an existing Ethernet network  One USB port for connecting a compatible USB printer, hard drive, or hub for connecting several devices Status light Internet WAN port Power port Power cord USB port Reset button Ethernet ports Security slot Ethernet activity light The reset button next to the ports is used for troubleshooting your Time Capsule. The status light on the front shows the current status.Chapter 1 Getting Started 9 About the AirPort Software Your Time Capsule works with AirPort Utility, installed in the Utilities folder in the Applications folder on a computer using Mac OS X, and in Start > All Programs > AirPort on a computer using Windows. If AirPort Utility isn’t installed on your computer, you can download it from www.apple.com/support/airport. Use AirPort Utility and follow the instructions on the following pages to set up your Time Capsule and your AirPort wireless network. Note:  You must use AirPort Utility v5.5.3 (or later) to set up your Time Capsule. This Time Capsule is not compatible with previous versions of AirPort software. AirPort Utility Use AirPort Utility to set up your Time Capsule to create a wireless network, connect to the Internet, and share compatible USB printers and hard disks. You can also connect your Time Capsule to an existing AirPort Extreme wireless network. AirPort Utility is also an advanced tool for setting up and managing the Time Capsule, AirPort Extreme, and AirPort Express Base Stations. Use it to manually adjust network, routing, and security settings and other advanced options. Z AirPort status menu Use the AirPort status menu in the menu bar to switch quickly between AirPort networks, monitor the signal quality of the current network, create a computer-to-computer network, and turn AirPort on or off. The status menu is available on computers using Mac OS X.10 Chapter 1 Getting Started What You Need to Get Started To use your Time Capsule, you need a wireless-enabled computer that’s compliant with IEEE 802.11a, 802.11b, 802.11g, or IEEE 802.11n standards. To set up your Time Capsule, your computer must meet the requirements listed below. Note:  To use your Time Capsule with Time Machine in Mac OS X, you need to use Mac OS X v10.5.7 or later. To set up your Time Capsule using a Mac, you need the following:  A Mac computer with an AirPort or AirPort Extreme Card installed to set it up wirelessly, or a Mac computer connected to your Time Capsule with an Ethernet cable to set it up using Ethernet  Mac OS X v10.5.7 or later  AirPort Utility v5.5.3 or later To set up your Time Capsule using a Windows computer, you need the following:  A Windows computer with 300 MHz or higher processor speed and a compatible 802.11a, 802.11b, or 802.11g, IEEE 802.11n wireless card, or a Windows computer connected to a Time Capsule with an Ethernet cable to set it up using Ethernet  Windows XP Home or Professional (SP3), Windows Vista (SP2), or Windows 7 (SP1)  AirPort Utility v5.5.3 or laterChapter 1 Getting Started 11 Plugging In Your Time Capsule Before you plug in your Time Capsule, first connect the appropriate cables to the ports you want to use:  Connect the Ethernet cable that’s connected to your DSL or cable modem (if you will connect to the Internet) to the Ethernet WAN (<) port.  Connect a USB cable connected from the USB (d) port on your Time Capsule to a compatible USB printer (if you will print to a USB printer), a hard disk, or a hub.  Connect an Ethernet cable from any Ethernet device to the Ethernet LAN (G) ports. After you’ve connected the cables for all the devices you plan to use, connect the power cord to the power port and plug your Time Capsule into a power outlet. There is no power switch. Important:  Use only the power cord that came with your Time Capsule. When you plug your Time Capsule into a power outlet, the status light flashes green for one second and then glows amber while your Time Capsule starts up. After your Time Capsule has started up completely, the status light flashes amber until your Time Capsule has been updated with the correct settings. The status light glows solid green after your Time Capsule is properly set up and connected to the Internet or a network. When you connect Ethernet cables to the Ethernet ports, the lights above them glow solid green.12 Chapter 1 Getting Started The Time Capsule Status Light The following table explains the Time Capsule light sequences and what they indicate. Light Status/description Off Your Time Capsule is unplugged. Solid amber Your Time Capsule is completing its startup sequence. Flashing amber Your Time Capsule can’t establish a connection to the network or the Internet, or is encountering a problem. Make sure you have installed AirPort Utility and use it to get information about what might cause the status light to flash amber. See “If Your Time Capsule Status Light Flashes Amber” on page 29. Solid green Your Time Capsule is on and working properly. If you choose Flash On Activity from the Status Light pop-up menu (in the Base Station pane of AirPort settings in AirPort Utility), the status light may flash green to indicate normal activity. Flashing amber and green There may be a problem starting up. Your Time Capsule will restart and try again. Solid blue Your Time Capsule is ready to allow a wireless client access to the network. See “Allowing Wireless Clients to Access Your Network Without Entering a Password” on page 23.Chapter 1 Getting Started 13 What’s Next After you plug in your Time Capsule, use AirPort Utility to set it up to work with your Internet connection, USB printer or hard disk, or an existing network. AirPort Utility is located in the Utilities folder in the Applications folder on a computer using Mac OS X, and in Start > All Programs > AirPort on a computer using Windows XP or Windows Vista.14 2 Setting Up Your Time Capsule This chapter provides information and instructions for connecting your Time Capsule to the Internet, and using AirPort Utility to set it up to create or join a wireless network. This chapter provides an overview of connecting your Time Capsule to the Internet, and using the setup assistant in AirPort Utility to set up your network and other features of your Time Capsule. For more information about wireless networking, and for information about the advanced features of AirPort Utility, refer to “Apple AirPort Networks” at www.apple.com/support/airport. You can do most of your network setup and configuration tasks using the setup assistant in AirPort Utility. To set advanced options, choose Manual Setup from the Base Station menu of AirPort Utility. See “Setting Advanced Options” on page 22.Chapter 2 Setting Up Your Time Capsule 15 Using Your Time Capsule to Create Your Wireless Network When you set up your Time Capsule to provide network and Internet access, the following computers and devices can access the wireless AirPort network to share files, play games, and use Internet applications such as web browsers and email applications:  Mac computers with AirPort or AirPort Extreme Cards  802.11a, 802.11b, 802.11g, and IEEE 802.11n wireless-equipped computers  Other Wi-Fi devices, such as iPad, iPhone, iPod Touch, and Apple TV Computers connected to your Time Capsule using Ethernet can also access the network to share files and connect to the Internet. With Mac OS X v10.5.7 or later you can set up Time Machine to back up all the computers on the network to your Time Capsule. See “Using Time Machine with Your Time Capsule” on page 24 for more information. When you connect a compatible USB printer to your Time Capsule, supported computers on the network (wired and wireless) can print to it.16 Chapter 2 Setting Up Your Time Capsule Using Time Capsule to create a wireless network to Internet DSL or cable modem < Internet WAN port Shared printer Time Capsule to USB port 2.4 or 5 GHz 2.4 GHz 2.4 or 5 GHz To set it up: 1 Connect your DSL or cable modem to your Time Capsule using the Ethernet WAN (<) port. 2 If you plan to share a USB printer on the network, connect it to the Time Capsule USB (d) port or to a USB hub using a USB cable.Chapter 2 Setting Up Your Time Capsule 17 3 Open AirPort Utility (located in the Utilities folder in the Applications folder on a computer using Mac OS X, and in Start > All Programs > AirPort on a computer using Windows), select your Time Capsule, and then click Continue. 4 Follow the onscreen instructions to create a new network. To print from a computer using Mac OS X v10.5 or later: 1 Choose Apple > System Preferences, and then click Print & Fax. 2 Click Add (+) and select your printer from the list. 3 Click the Add button. If your printer isn’t in the list, use the buttons in the toolbar to search for it. To print from a computer using Mac OS X v10.2.7 or later: 1 Open Printer Setup Utility (located in the Utilities folder in the Applications folder). 2 Select your printer from the list. If your printer isn’t in the list, click Add and choose Bonjour from the pop-up menu, and then select your printer from the list. To print from a computer using Windows XP, Windows Vista, or Windows 7: Use Bonjour for Windows and follow the onscreen instructions to connect to your printer. Computers using AirPort or other compatible wireless cards or adapters can connect to the Internet through your Time Capsule. Computers connected to the Time Capsule Ethernet ports can also access the network and connect to the Internet. Wireless computers and computers connected to the Ethernet ports can also communicate with each other through your Time Capsule.18 Chapter 2 Setting Up Your Time Capsule Using AirPort Utility To set up and configure your Time Capsule, use the setup assistant in AirPort Utility. On a Mac computer using Mac OS X v10.5.7 or later: 1 Open AirPort Utility, located in the Utilities folder in the Applications folder. 2 Select your Time Capsule and click Continue. If you don’t see the Time Capsule you want to configure, click Rescan to scan for available wireless devices, and then select your Time Capsule from the list. 3 Follow the onscreen instructions to set up your Time Capsule and your wireless network. On a computer using Windows XP (SP3), Windows Vista (SP2), or Windows 7 (SP1): 1 Open AirPort Utility, located in Start > All Programs > AirPort. 2 Select your Time Capsule and click Continue. If AirPort Utility isn’t installed on your computer, you can download it from www.apple.com/support/airport.Chapter 2 Setting Up Your Time Capsule 19 3 Follow the onscreen instructions to set up your Time Capsule and your wireless network. The AirPort Utility setup assistant asks you questions about the type of network you want to use and the services you want to set up, and helps you enter the appropriate settings. If you’re using your Time Capsule to connect to the Internet, you need a broadband (DSL or cable modem) account with an Internet service provider (ISP), or a connection to the Internet using an existing Ethernet network. If you received specific information from your ISP (such as a static IP address or a DHCP client ID), you may need to enter it in AirPort Utility. Have this information available when you set up your Time Capsule.20 Chapter 2 Setting Up Your Time Capsule Creating a New Wireless Network You can use the AirPort Utility setup assistant to create a new wireless network. The setup assistant guides you through the steps necessary to name your network, protect your network with a password, and set other options. If you plan to share a USB printer or USB hard disk on your network: 1 Connect the printer or hard disk to the Time Capsule USB (d) port. 2 Open AirPort Utility, located in the Utilities folder in the Applications folder on a Mac, or in Start > All Programs > AirPort on a computer using Windows. 3 Select your Time Capsule and click Continue. If you don’t see the Time Capsule you want to configure, click Rescan to scan for available wireless devices, and then select your Time Capsule from the list. 4 Follow the onscreen instructions to create a new network. Configuring and Sharing Internet Access If you plan to share your Internet connection with wireless-enabled computers on your network or with computers connected to the Ethernet ports, you need to set up your Time Capsule as an AirPort base station. After your Time Capsule is set up, computers access the Internet through the AirPort network. Your Time Capsule connects to the Internet and transmits information to the computers over the wireless network. Before you use AirPort Utility to set up your Time Capsule, connect your DSL or cable modem to the Time Capsule Ethernet WAN (<) port. If you’re connecting your Time Capsule to an Ethernet network that already has Internet access, connect it to the Ethernet network.Chapter 2 Setting Up Your Time Capsule 21 Use the AirPort Utility setup assistant to enter your ISP settings and configure how your Time Capsule shares the settings with other computers. 1 Open AirPort Utility, located in the Utilities folder in the Applications folder on a computer using Mac OS X, or in Start > All Programs > AirPort on a computer using Windows. If AirPort Utility isn’t installed on your computer, you can download it from www.apple.com/support/airport. 2 Select your Time Capsule and click Continue. If you’re making changes to a Time Capsule that has already been set up, you might have to connect to the network it’s created before making changes to the Time Capsule. To choose the wireless network you want to change on a Mac, use the AirPort status menu in the menu bar. On a computer using Windows, hold the pointer over the wireless connection icon until you see the network name (SSID), and then choose it from the list if there are multiple networks available. 3 Follow the onscreen instructions to configure and share Internet access on your Time Capsule. AirPort Utility provides a quick and easy way to set up your Time Capsule and network. If you want to set additional options for your network, such as restricting access to your network or setting advanced DHCP options, choose Manual Setup from the Base Station menu of AirPort Utility.22 Chapter 2 Setting Up Your Time Capsule Setting Advanced Options Use AirPort Utility to set up your Time Capsule manually if you want to set advanced Time Capsule options such as advanced security options, closed networks, DHCP lease time, access control, power controls, user accounts, and more. To set advanced options: 1 Open AirPort Utility, located in the Utilities folder in the Applications folder on a Mac, and in Start > All Programs > AirPort on a computer using Windows. If AirPort Utility isn’t installed on your computer, you can download it from www.apple.com/support/airport. 2 If there’s more than one wireless device in the list, select the one you want to configure. If you don’t see the Time Capsule you want to configure, click Rescan to scan for available wireless devices, and then select your Time Capsule from the list. If you’re making changes to a Time Capsule that has already been set up, you might have to connect to the network it’s created before making changes to your Time Capsule. To choose the wireless network you want to change on a Mac, use the AirPort status menu in the menu bar. On a computer using Windows, hold the pointer over the wireless connection icon until you see the network name (SSID), and then choose it from the list if there are multiple networks available. 3 Choose Manual Setup from the Base Station menu. If you’re prompted for a password, enter it. For more about the manual setup features in AirPort Utility, see “Apple AirPort Networks” at www.apple.com/support/airport.Chapter 2 Setting Up Your Time Capsule 23 Allowing Wireless Clients to Access Your Network Without Entering a Password If your network is password-protected using WPA Personal or WPA/WPA2 Personal, you can provide wireless clients access to your network without requiring them to enter the network password. When you allow a client access to your network, the client’s name and wireless MAC address (or AirPort ID) are stored in the access control list of AirPort Utility until you remove the client from the list. You can also provide 24 hours of access, after which time the client can no longer access your network. When you give a client access to your wireless network, the client doesn’t need to enter the network password. To allow a client to access your network without entering the network password: 1 Open AirPort Utility, select your Time Capsule, and then choose Manual Setup from the Base Station menu. Enter the password if necessary. 2 Choose Add Wireless Clients from the Base Station menu. 3 Select how you want the client to access the network:  Select PIN to enter the eight-digit number provided by the client requesting network access.  Select“First attempt”to allow network access to the first client attempting to join the network. While the Time Capsule waits for a client to join the network, the LED glows blue.24 Chapter 2 Setting Up Your Time Capsule Select“Limit client’s access to 24 hours”if you want to provide just one day of access to your network. If you don’t select this option, the client has access until you remove the client from the list. Using Time Machine with Your Time Capsule With the Time Machine application in Mac OS X (Leopard or later) you can back up everything on your computer, including your photos, music, movies, and documents. After you set up Time Machine, it automatically backs up your computer on a regular basis. If you’re using Mac OS X v10.5.7 or later, the first time you connect to your Time Capsule, Time Machine asks if you’d like to use it to back up your files. Click “Use as Backup Disk,” and Time Machine takes care of the rest. Use the Time Machine pane of System Preferences to set up automatic backups, change to a different backup disk, or adjust other settings. To set up or adjust Time Machine on a computer using Mac OS X Leopard or later: 1 Choose Apple > System Preferences, and then click Time Machine. 2 Slide the switch to ON. 3 Click Change Disk. 4 Choose your Time Capsule and click “Use for Backup.”Chapter 2 Setting Up Your Time Capsule 25 Your first backup with Time Capsule and Time Machine could take overnight or longer, depending on how much data you’re backing up. To speed up the initial backup, connect your Time Capsule to your computer using Ethernet. In each subsequent backup, Time Machine backs up only files that have changed since the previous backup, so the backups don’t take as long. Time Capsule is a great wireless backup solution for portable computers. Since the first backup can take some time, plug your portable into a power adapter—this conserves battery power and guarantees that backups won’t be interrupted. Also, for the best wireless performance, place your portable computer in the same room as your Time Capsule. If you shut down your Mac or put it to sleep during a backup, Time Machine stops the backup and then continues from where it left off after your Mac starts up again. For more information about Time Machine, choose Help > Mac Help from the Finder menu on a computer using Mac OS X Leopard or later, and then type Time Machine in the search field.26 3 Tips and Troubleshooting You can quickly solve most problems with your Time Capsule by following the advice in this chapter. If You Can’t Connect to the Internet  Try connecting to the Internet directly from your computer. If you can’t connect, check to make sure your network settings are correct. If they appear to be correct and you still can’t connect, contact your Internet service provider (ISP).  Make sure you’re connecting to the correct wireless network. If You Forgot Your Network Password or Time Capsule Password You can clear the AirPort network password or Time Capsule password by resetting your Time Capsule. To reset the Time Capsule password: 1 Use something pointed (such as a ballpoint pen) to press and hold down the reset button for one second. Important:  If you hold the reset button for more than one second, you may lose your network settings.Chapter 3 Tips and Troubleshooting 27 2 Select your AirPort network.  On a Mac, use the AirPort status menu in the menu bar to select the network created by your Time Capsule (the network name doesn’t change).  On a computer using Windows, hold the pointer over the wireless connection icon until you see your AirPort network name (SSID), and choose it from the list if there are multiple networks available. 3 Open AirPort Utility (in the Utilities folder in the Applications folder on a Mac, and in Start > All Programs > AirPort on a computer using Windows). If AirPort Utility isn’t installed on your computer, you can download it from www.apple.com/support/airport. 4 Select your Time Capsule, and then choose Manual Setup from the Base Station menu. 5 Click AirPort in the toolbar, and then click Base Station. 6 Enter a new password for your Time Capsule. 7 Click Wireless and choose an encryption method from the Wireless Security pop-up menu to turn on encryption and activate password protection for your AirPort network. If you turn on encryption, enter a new password for your AirPort network. 8 Click Update to restart your Time Capsule and load the new settings.28 Chapter 3 Tips and Troubleshooting If Your Time Capsule Isn’t Responding Try unplugging it and plugging it back in. If your Time Capsule stops responding completely, you may need to reset it to the factory default settings. Important:  Resetting your Time Capsule to factory default settings erases all of the current settings and resets them to the settings that came with your Time Capsule. To return your Time Capsule to the factory settings: m Use something pointed (such as a ballpoint pen) to press down and hold the reset button until the status light flashes quickly (about 5 seconds). Your Time Capsule resets with the following settings:  Your Time Capsule receives its IP address using DHCP.  The network name is reset to Apple Network XXXXXX (where XXXXXX is replaced with the last six digits of the AirPort ID).  The Time Capsule password is reset to public. If your Time Capsule still isn’t responding, try the following: 1 Unplug your Time Capsule. 2 Use something pointed to press and hold down the reset button while you plug in your Time Capsule.Chapter 3 Tips and Troubleshooting 29 If Your Time Capsule Status Light Flashes Amber The Ethernet cable may not be connected properly, your Time Capsule may be out of range of an AirPort network, or there may be a problem with your Internet service provider. If you’re connected to the Internet with a DSL or cable modem, the modem may have lost its connection to the network or the Internet. Even if the modem seems to be working properly, try disconnecting it from its power supply, waiting a few seconds, and then reconnecting it. Make sure your Time Capsule is connected directly to the modem via Ethernet before reconnecting power to the modem. For more information about why the light is flashing, open AirPort Utility, select your Time Capsule, and then choose Manual Setup from the Base Station menu. Click Base Station Status to display information about the flashing light. You can also select“Monitor base station for problems”in AirPort preferences. If the base station has a problem, AirPort Utility opens and walks you through solving the problem.30 Chapter 3 Tips and Troubleshooting If Your Printer Isn’t Responding If you connected a printer to the USB port on your Time Capsule and the computers on the AirPort network can’t print, try the following: 1 Make sure the printer is plugged in and turned on. 2 Make sure the cables are securely connected to the printer and to the Time Capsule USB port. 3 Make sure the printer is selected in the Printer List window on client computers. On a Mac using Mac OS X v10.5 or later:  Choose Apple > System Preferences, and then click Print & Fax.  Click Add (+) and select your printer in the list, and then click Add (+). On a Mac using Mac OS X v10.2.7 or later:  Open Printer Setup Utility, located in the Utilities folder in the Applications folder.  If the printer isn’t in the list, click Add.  Choose Bonjour from the pop-up menu, select the printer and click Add (+). On a computer using Windows:  Open “Printers and Faxes”from the Start menu.  Select the printer. If the printer isn’t in the list, click Add Printer and then follow the onscreen instructions.  If Bonjour for Windows is installed, click the Bonjour Printer, click the Bonjour Printer Wizard on the desktop, and then follow the onscreen instructions for setting up a printer. 4 Turn off the printer, wait a few seconds, and then turn it back on.Chapter 3 Tips and Troubleshooting 31 Updating AirPort Software Apple periodically updates AirPort software. It is recommended that you update your Time Capsule to use the latest software. You can select“Check for updates when opening AirPort Utility,” or“Check for updates” in AirPort preferences. If you select“Check for updates,” choose an increment of time, such as weekly, from the pop-up menu to automatically check for updates. Time Capsule Placement Considerations The following recommendations can help your Time Capsule achieve the best wireless range and network coverage.  Place your Time Capsule in an open area where there are few obstructions, such as large pieces of furniture or walls. Try to place it away from metallic surfaces.  If you place your Time Capsule behind furniture, keep at least an inch of space between the Time Capsule and the edge of the furniture.  Avoid placing your Time Capsule in areas surrounded by metal surfaces on three or more sides.  If you place your Time Capsule in an entertainment center with your stereo equipment, avoid surrounding your Time Capsule with audio, video, or power cables. Place your Time Capsule so that the cables are to one side. Maintain as much space as possible between your Time Capsule and the cables.  Try to place your Time Capsule at least 25 feet (7.6 meters) from any microwave oven, 2.4 or 5 gigahertz (GHz) cordless phone, and other sources of interference.  Do not place other objects (books, papers, small pets, etc.) on top of the Time Capsule. It may interfere with Time Capsule cooling.32 Chapter 3 Tips and Troubleshooting Items That Can Cause Interference with AirPort The farther away the interference source, the less likely it is to cause a problem. The following can interfere with AirPort communication:  Microwave ovens  Direct Satellite Service (DSS) radio frequency leakage  The original coaxial cable that came with certain types of satellite dishes. Contact the device manufacturer and obtain newer cables.  Certain electrical devices such as power lines, electrical railroad tracks, and power stations.  Cordless telephones that operate in the 2.4 or 5 GHz range. If you have problems with your phone or AirPort communication, change the channel your base station or Time Capsule uses, or change the channel your phone uses.  Nearby base stations using adjacent channels. For example, if base station A is set to channel 1, base station B should be set to channel 6 or 11.4 33 Learning More, Service, and Support You can find more information about using your Time Capsule on the web and in onscreen help. Online Resources For the latest information about the Time Capsule, go to www.apple.com/airport. To register your Time Capsule, go to www.apple.com/register. For AirPort support information, forums with product-specific information and feedback, and the latest Apple software downloads, go to www.apple.com/support/airport. For support outside of the United States, go to www.apple.com/support, and then choose your country.34 Chapter 4 Learning More, Service, and Support Onscreen Help To learn more about using AirPort Utility with your Time Capsule, open AirPort Utility and choose Help > AirPort Utility Help. Obtaining Warranty Service If your Time Capsule appears to be damaged or doesn’t function properly, follow the advice in this booklet, the onscreen help, and the online resources. If your Time Capsule still doesn’t function, go to www.apple.com/support for information about getting warranty service. Finding the Serial Number of Your Time Capsule The serial number is printed on the bottom of your Time Capsule.35 Appendix Time Capsule Specifications and Safety Guidelines Time Capsule Specifications  Frequency Band: 2.4 and 5 GHz  Radio Output Power: Up to 23 dBm (nominal)  Standards: 802.11 DSSS 1 and 2 Mbps standard, 802.11a, 802.11b, 802.11g, and 802.11n specifications Interfaces  1 RJ-45 10/100/1000Base-T Gigabit Ethernet WAN (<)  3 RJ-45 10/100/1000Base-T Gigabit Ethernet LAN (G)  Universal Serial Bus (USB d) 2.0  802.11 a/b/g/n AirPort Extreme wireless Environmental Specifications  Operating Temperature: 32° F to 95° F (0° C to 35° C)  Storage Temperature: –13° F to 140° F (–25° C to 60° C)  Relative Humidity (Operational): 20% to 80% relative humidity  Relative Humidity (Storage): 10% to 90% relative humidity, noncondensing36 Appendix Time Capsule Specifications and Safety Guidelines Size and Weight  Length: 7.75 inches (197.0 mm)  Width: 7.75 inches (197.0 mm)  Height: 1.43 inches (36.33 mm)  Weight: 3.5 pounds (1.6 kilograms) Hardware Media Access Control (MAC) Addresses The Time Capsule has three hardware addresses printed on the bottom of the case:  AirPort ID: The two addresses used to identify the Time Capsule on a wireless network.  Ethernet ID: You may need to provide this address to your ISP to connect your Time Capsule to the Internet. Using Your Time Capsule Safely  The only way to shut off power completely to your Time Capsule is to disconnect it from the power source.  When connecting or disconnecting your Time Capsule, always hold the plug by its sides. Keep fingers away from the metal part of the plug.  Your Time Capsule should not be opened for any reason, even when it’s unplugged. If your Time Capsule needs service,see“Learning More, Service, and Support”on page 33.  Never force a connector into a port. If the connector and port don’t join with reasonable ease, they probably don’t match. Make sure that the connector matches the port and that you’ve positioned the connector correctly in relation to the port.Appendix Time Capsule Specifications and Safety Guidelines 37 About Operating and Storage Temperatures When you’re using your Time Capsule, it is normal for the case to get warm. The Time Capsule case functions as a cooling surface that transfers heat from inside the unit to the cooler air outside. Avoid Wet Locations WARNING:  To reduce the chance of shock or injury, do not use your Time Capsule in or near water or wet locations.  Keep your Time Capsule away from sources of liquid, such as drinks, washbasins, bathtubs, shower stalls, and so on.  Protect your Time Capsule from direct sunlight and rain or other moisture.  Take care not to spill any food or liquid on your Time Capsule. If you do, unplug it before cleaning up the spill.  Do not use your Time Capsule outdoors. The Time Capsule is an indoor product. Do Not Make Repairs Yourself WARNING:  Do not attempt to open your Time Capsule or disassemble it. You run the risk of electric shock and voiding the limited warranty. No user-serviceable parts are inside. About Handling Your Time Capsule may be damaged by improper storage or handling. Be careful not to drop your Time Capsule when transporting it.38 FCC Declaration of Conformity This device complies with part 15 of the FCC rules. Operation is subject to the following two conditions: (1) This device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. See instructions if interference to radio or television reception is suspected. Radio and Television Interference This computer equipment generates, uses, and can radiate radiofrequency energy. If it is not installed and used properly—that is, in strict accordance with Apple’s instructions—it may cause interference with radio and television reception. This equipment has been tested and found to comply with the limits for a Class B digital device in accordance with the specifications in Part 15 of FCC rules. These specifications are designed to provide reasonable protection against such interference in a residential installation. However, there is no guarantee that interference will not occur in a particular installation. You can determine whether your computer system is causing interference by turning it off. If the interference stops, it was probably caused by the computer or one of the peripheral devices. If your computer system does cause interference to radio or television reception, try to correct the interference by using one or more of the following measures: • Turn the television or radio antenna until the interference stops. • Move the computer to one side or the other of the television or radio. • Move the computer farther away from the television or radio. • Plug the computer into an outlet that is on a different circuit from the television or radio. (That is, make certain the computer and the television or radio are on circuits controlled by different circuit breakers or fuses.) If necessary, consult an Apple Authorized Service Provider or Apple. See the service and support information that came with your Apple product. Or, consult an experienced radio/television technician for additional suggestions. Important:  Changes or modifications to this product not authorized by Apple Inc. could void the EMC compliance and negate your authority to operate the product. This product was tested for FCC compliance under conditions that included the use of Apple peripheral devices and Apple shielded cables and connectors between system components. It is important that you use Apple peripheral devices and shielded cables and connectors between system components to reduce the possibility of causing interference to radios, television sets, and other electronic devices. You can obtain Apple peripheral devices and the proper shielded cables and connectors through an Appleauthorized dealer. For non-Apple peripheral devices, contact the manufacturer or dealer for assistance. Responsible party (contact for FCC matters only) Apple Inc. Corporate Compliance 1 Infinite Loop M/S 26-A Cupertino, CA 95014 Wireless Radio Use This device is restricted to indoor use when operating in the 5.15 to 5.25 GHz frequency band. Cet appareil doit être utilisé à l’intérieur. Exposure to Radio Frequency Energy The radiated output power of the AirPort Card in this device is below the FCC and EU radio frequency exposure limits for uncontrolled equipment. This device should be operated with a minimum distance of at least 20 cm between the AirPort Card antennas and a person’s body and must not be co-located or operated with any other antenna or transmitter subject to the conditions of the FCC Grant.39 Canadian Compliance Statement This device complies with Industry Canada license-exempt RSS standard(s). Operation is subject to the following two conditions: (1) this device may not cause interference, and (2) this device must accept any interference, including interference that may cause undesired operation of the device. Cet appareil est conforme aux normes CNR exemptes de licence d’Industrie Canada. Le fonctionnement est soumis aux deux conditions suivantes : (1) cet appareil ne doit pas provoquer d’interférences et (2) cet appareil doit accepter toute interférence, y compris celles susceptibles de provoquer un fonctionnement non souhaité de l’appareil. Industry Canada Statement Complies with the Canadian ICES-003 Class B specifications. Cet appareil numérique de la classe B est conforme à la norme NMB-003 du Canada. This device complies with RSS 210 of Industry Canada. Europe–EU Declaration of Conformity Български Apple Inc. декларира, че това WLAN Access Point е в съответствие със съществените изисквания и другите приложими правила на Директива 1999/5/ЕС. Česky Společnost Apple Inc. tímto prohlašuje, že tento WLAN Access Point je ve shodě se základními požadavky a dalšími příslušnými ustanoveními směrnice 1999/5/ES. Dansk Undertegnede Apple Inc. erklærer herved, at følgende udstyr WLAN Access Point overholder de væsentlige krav og øvrige relevante krav i direktiv 1999/5/EF. Deutsch Hiermit erklärt Apple Inc., dass sich das Gerät WLAN Access Point in Übereinstimmung mit den grundlegenden Anforderungen und den übrigen einschlägigen Bestimmungen der Richtlinie 1999/5/EG befinden. Eesti Käesolevaga kinnitab Apple Inc., et see WLAN Access Point vastab direktiivi 1999/5/EÜ põhinõuetele ja nimetatud direktiivist tulenevatele teistele asjakohastele sätetele. English Hereby, Apple Inc. declares that this WLAN Access Point is in compliance with the essential requirements and other relevant provisions of Directive 1999/5/EC. Español Por medio de la presente Apple Inc. declara que este WLAN Access Point cumple con los requisitos esenciales y cualesquiera otras disposiciones aplicables o exigibles de la Directiva 1999/5/CE. Ελληνικά Mε την παρούσα, η Apple Inc. δηλώνει ότι αυτή η συσκευή WLAN Access Point συμμορφώνεται προς τις βασικές απαιτήσεις και τις λοιπές σχετικές διατάξεις της Οδηγίας 1999/5/ΕΚ. Français Par la présente Apple Inc. déclare que l’appareil WLAN Access Point est conforme aux exigences essentielles et aux autres dispositions pertinentes de la directive 1999/5/CE. Islenska Apple Inc. lýsir því hér með yfir að þetta tæki WLAN Access Point fullnægir lágmarkskröfum og öðrum viðeigandi ákvæðum Evróputilskipunar 1999/5/EC. Italiano Con la presente Apple Inc. dichiara che questo dispositivo WLAN Access Point è conforme ai requisiti essenziali ed alle altre disposizioni pertinenti stabilite dalla direttiva 1999/5/CE. Latviski Ar šo Apple Inc. deklarē, ka WLAN Access Point ierīce atbilst Direktīvas 1999/5/EK būtiskajām prasībām un citiem ar to saistītajiem noteikumiem. Lietuvių Šiuo „Apple Inc.“ deklaruoja, kad šis WLAN Access Point atitinka esminius reikalavimus ir kitas 1999/5/EB Direktyvos nuostatas. Magyar Alulírott, Apple Inc. nyilatkozom, hogy a WLAN Access Point megfelel a vonatkozó alapvetõ követelményeknek és az 1999/5/EC irányelv egyéb elõírásainak. 40 Malti Hawnhekk, Apple Inc., jiddikjara li dan WLAN Access Point jikkonforma mal-ħtiġijiet essenzjali u ma provvedimenti oħrajn relevanti li hemm fid-Dirrettiva 1999/5/EC. Nederlands Hierbij verklaart Apple Inc. dat het toestel WLAN Access Point in overeenstemming is met de essentiële eisen en de andere bepalingen van richtlijn 1999/5/EG. Norsk Apple Inc. erklærer herved at dette WLAN Access Point -apparatet er i samsvar med de grunnleggende kravene og øvrige relevante krav i EU-direktivet 1999/5/EF. Polski Niniejszym Apple Inc. oświadcza, że ten WLAN Access Point są zgodne z zasadniczymi wymogami oraz pozostałymi stosownymi postanowieniami Dyrektywy 1999/5/EC. Português Apple Inc. declara que este dispositivo WLAN Access Point está em conformidade com os requisitos essenciais e outras disposições da Directiva 1999/5/CE. Română Prin prezenta, Apple Inc. declară că acest aparat WLAN Access Point este în conformitate cu cerinţele esenţiale şi cu celelalte prevederi relevante ale Directivei 1999/5/CE. Slovensko Apple Inc. izjavlja, da je ta WLAN Access Point skladne z bistvenimi zahtevami in ostalimi ustreznimi določili direktive 1999/5/ES. Slovensky Apple Inc. týmto vyhlasuje, že toto WLAN Access Point spĺňa základné požiadavky a všetky príslušné ustanovenia Smernice 1999/5/ES. Suomi Apple Inc. vakuuttaa täten, että tämä WLAN Access Point tyyppinen laite on direktiivin 1999/5/EY oleellisten vaatimusten ja sitä koskevien direktiivin muiden ehtojen mukainen. Svenska Härmed intygar Apple Inc. att denna WLAN Access Point står i överensstämmelse med de väsentliga egenskapskrav och övriga relevanta bestämmelser som framgår av direktiv 1999/5/EG. A copy of the EU Declaration of Conformity is available at: www.apple.com/euro/compliance This Apple WLAN Access Point can be used in the following countries: AT EE BG FI BE FR CY DE CZ GR DK HU IE IT LV LT LU MT NL PL PT RO SK SL ES SE GB IS LI NO CH Korea Warning Statements B૶ૺૺ(ਜ਼ႜဧ෮໽ቛཅૺၴႁ) ၦૺૺ௴ਜ਼ႜဧ(B૶) ႖ၴኒ႕ጁૺૺച໏჎ച ਜ਼ႜ࿝໏ຫဧዻ௴ઇၕඛ႕ၒചዻඑ, ක౷ხ ࿦࿝໏ຫဧዾ༘ၰཀఁఋ. ෮ቛ၁ધགྷ࿝ಋ൏ધხຫጃ ጄఙඳ໓໕๗௴ဪဧთ႖ኒጯཅਜ਼௻ໜၦၰၗ ၦૺૺ௴ၨ඗ྦ႖઴શഏౘ໏๗༺࿝ຫဧዾ༘࿖ཀఁఋ ఝዽූ૑ ૬ႜ ෟ ა༘ Singapore Wireless Certification41 Taiwan Wireless Statements Taiwan Class B Statement 警告 本電池如果更換不正確會有爆炸的危險 請依製造商說明書處理用過之電池 Japan VCCI Class B Statement Russia Disposal and Recycling Information This symbol indicates that your product must be disposed of properly according to local laws and regulations.When your product reaches its end of life, contact Apple or your local authorities to learn about recycling options. For information about Apple’s recycling program, go to www.apple.com/recycling. European Union — Disposal Information This symbol means that according to local laws and regulations your product should be disposed of separately from household waste.When this product reaches its end of life, take it to a collection point designated by local authorities. Some collection points accept products for free. The separate collection and recycling of your product at the time of disposal will help conserve natural resources and ensure that it is recycled in a manner that protects human health and the environment. Türkiye EEE yönetmeliğine (Elektrikli ve Elektronik Eşyalarda Bazı Zararlı Maddelerin Kullanımının Sınırlandırılmasına Dair Yönetmelik) uygundur.42 Brasil—Informações sobre descarte e reciclagem O símbolo acima indica que este produto e/ou sua bateria não devem ser descartadas no lixo doméstico. Quando decidir descartar este produto e/ou sua bateria, faça-o de acordo com as leis e diretrizes ambientais locais. Para informações sobre o programa de reciclagem da Apple, pontos de coleta e telefone de informações, visite www.apple.com/br/environment Battery Disposal Information Dispose of batteries according to your local environmental laws and guidelines. Deutschland: Dieses Gerät enthält Batterien. Bitte nicht in den Hausmüll werfen. Entsorgen Sie dieses Gerät am Ende seines Lebenszyklus entsprechend der maßgeblichen gesetzlichen Regelungen. Nederlands:  Gebruikte batterijen kunnen worden ingeleverd bij de chemokar of in een speciale batterijcontainer voor klein chemisch afval (kca) worden gedeponeerd. China Battery Statement Taiwan Battery Statementwww.apple.com/airport www.apple.com/support/airport © 2011 Apple Inc. All rights reserved. Apple, the Apple logo, AirPort, AirPort Express, AirPort Extreme, Apple TV, Bonjour, Finder, iPhone, iPod touch, Leopard, Mac, Mac OS, Time Capsule, and Time Machine are trademarks of Apple Inc., registered in the U.S. and other countries. iPad is a trademark of Apple Inc. Other product and company names mentioned herein may be trademarks of their respective companies. 034-5910-A Printed in XXXX Time Capsule Setup Guide3 Contents 5 Chapter 1: Getting Started 7 About Your Time Capsule 8 About the AirPort Software 9 What You Need to Get Started 11 The Time Capsule Status Light 13 Chapter 2: Setting Up Your Time Capsule 14 Using Your Time Capsule to Create Your Wireless Network 17 Using AirPort Utility 19 Creating a New Wireless Network 19 Configuring and Sharing Internet Access 21 Setting Advanced Options 22 Allowing Wireless Clients to Access Your Network Without Entering a Password 23 Using Time Machine with Your Time Capsule 25 Chapter 3: Tips and Troubleshooting 25 If You Can’t Connect to the Internet 25 If You Forgot Your Network Password or Time Capsule Password 26 If Your Time Capsule Isn’t Responding 27 If Your Time Capsule Status Light Flashes Amber4 Contents 28 If Your Printer Isn’t Responding 29 Updating AirPort Software 29 Time Capsule Placement Considerations 30 Items That Can Cause Interference with AirPort 31 Chapter 4: Learning More, Service, and Support 33 Appendix: Time Capsule Specifications and Safety Guidelines 36 Regulatory Compliance Information1 5 1 Getting Started Congratulations on purchasing your Time Capsule. Read this guide to get started. The new Time Capsule offers you the simplicity of fully automated backup for your Wi-Fi network. Using the Time Machine application in Mac OS X v10.5.2 Leopard or later, it’s easy and automatic to back up all the computers on your network to a single Time Capsule. The Time Capsule is also a fully featured AirPort Extreme Base Station that provides simultaneous dual-band wireless networking. When you set up your Time Capsule, it creates two high-speed Wi-Fi networks:  A 2.4 gigahertz (GHz) network for 802.11b, 802.11g, and 802.11n devices, such as iPhone, iPod touch, and older computers  A 5 GHz network for 802.11n and 802.11a devices, such as newer computers and Apple TV Wireless devices join the network that provides them the best performance and compatibility, and the Time Capsule shares your broadband Internet connection with computers and devices on your network.6 Chapter 1 Getting Started With your Time Capsule, you can:  Use the Time Machine application in Mac OS X v10.5.2 (or later) to back up all the computers on your wireless network, as well as computers connected to your Time Capsule using Ethernet. Note: Your first backup with Time Capsule and Time Machine could take overnight or longer, depending on how much data you’re backing up. To speed up the initial backup, use an Ethernet cable to connect your computer to the LAN port on your Time Capsule. For more information about using Time Machine, see “Using Time Machine with Your Time Capsule” on page 23.  Create a password-protected wireless home network, and then connect to the Internet and share the connection with other computers and Wi-Fi devices, such as iPhone, iPod touch, and Apple TV. You can also share files among computers connected to the network.  Create a guest network with or without password protection, to provide Internetonly access to wireless devices, such as computers, iPhone, iPod touch, and Apple TV.  Connect your Time Capsule to your Ethernet network. Wireless-equipped Macintosh, Windows XP, or Windows Vista computers can then have access to an entire network without being connected by a cable.  Connect a supported USB printer to your Time Capsule. Compatible computers on the AirPort network, both wireless and wired, can print to it.  Connect an additional USB hard drive to your Time Capsule. Compatible computers on the AirPort network, both wireless and wired, can access information on the hard disk.Chapter 1 Getting Started 7  Connect a USB hub to your Time Capsule, and then connect multiple USB devices, such as printers or hard disks. All computers on the network have access to those devices. Important: Install AirPort Utility 5.4 from the CD that came with your Time Capsule, or download it using Software Update. Previous versions of AirPort Setup Assistant and AirPort Admin Utility are not compatible with this Time Capsule. About Your Time Capsule Your Time Capsule has five ports on the back:  One 10/100/1000Base-T Gigabit Ethernet Wide Area Network (WAN) port for connecting a DSL or cable modem, or for connecting to an existing Ethernet network  Three 10/100/1000Base-T Gigabit Ethernet Local Area Network (LAN) ports for connecting Ethernet devices, such as printers or computers, or for connecting to an existing Ethernet network 8 Chapter 1 Getting Started  One USB port for connecting a compatible USB printer, hard drive, or hub for connecting several devices The reset button next to the ports is used for troubleshooting your Time Capsule. The status light on the front shows the current status. About the AirPort Software Your Time Capsule works with AirPort Utility, included on the Time Capsule CD. Install AirPort Utility and follow the instructions on the following pages to set up your Time Capsule and your AirPort wireless network. Status light Internet WAN port Power port Power cord USB port Reset button Ethernet ports Security slot Ethernet activity lightChapter 1 Getting Started 9 Note: You must use AirPort Utility v5.4 to set up your Time Capsule. This Time Capsule is not compatible with previous versions of AirPort software. What You Need to Get Started To use your Time Capsule, you need a wireless-enabled computer that’s compliant with IEEE 802.11a, 802.11b, or 802.11g standards, or with an IEEE 802.11n draft specification. To set up your Time Capsule, your computer must meet the requirements listed below. Note: To use your Time Capsule with Time Machine in Mac OS X Leopard, you need to use Mac OS X v10.5.2 or later. To set up your Time Capsule using a Macintosh, you need the following:  A Macintosh computer with an AirPort or AirPort Extreme Card installed to set it up wirelessly, or a Macintosh computer connected to your Time Capsule with an Ethernet cable to set it up using Ethernet AirPort Utility Use AirPort Utility to set up your Time Capsule to create a wireless network, connect to the Internet, and share compatible USB printers and hard disks. You can also connect your Time Capsule to an existing AirPort Extreme wireless network. AirPort Utility is also an advanced tool for setting up and managing the Time Capsule, AirPort Extreme, and AirPort Express Base Stations. Use it to manually adjust network, routing, and security settings and other advanced options. Z AirPort status menu Use the AirPort status menu in the menu bar to switch quickly between AirPort networks, monitor the signal quality of the current network, create a computer-tocomputer network, and turn AirPort on or off. The status menu is available on computers using Mac OS X. 10 Chapter 1 Getting Started  Mac OS X v10.4 or later  AirPort Utility v5.4 or later To set up your Time Capsule using a Windows PC, you need the following:  A Windows PC with 300 MHz or higher processor speed and a compatible 802.11a, 802.11b, or 802.11g wireless card, or a wireless card that complies with an IEEE 802.11n draft specification  Windows XP Home or Professional (with Service Pack 2 installed) or Windows Vista  AirPort Utility v5.4 or later Plugging In Your Time Capsule Before you plug in your Time Capsule, first connect the appropriate cables to the ports you want to use:  Connect the Ethernet cable that’s connected to your DSL or cable modem (if you will connect to the Internet) to the Ethernet WAN (<) port.  Connect a USB cable connected from the USB (d) port on your Time Capsule to a compatible USB printer (if you will print to a USB printer), a hard disk, or a hub.  Connect an Ethernet cable from any Ethernet device to the Ethernet LAN (G) ports. After you’ve connected the cables for all the devices you plan to use, connect the power cord to the power port and plug your Time Capsule into a power outlet. There is no power switch. Important: Use only the power cord that came with your Time Capsule.Chapter 1 Getting Started 11 When you plug your Time Capsule into a power outlet, the status light flashes green for one second and then glows amber while your Time Capsule starts up. After your Time Capsule has started up completely, the status light flashes amber until your Time Capsule has been updated with the correct settings. The status light glows solid green after your Time Capsule is properly set up and connected to the Internet or a network. When you connect Ethernet cables to the Ethernet ports, the lights above them glow solid green. The Time Capsule Status Light The following table explains the Time Capsule light sequences and what they indicate. Light Status/description Off Your Time Capsule is unplugged. Solid amber Your Time Capsule is completing its startup sequence. Flashing amber Your Time Capsule can’t establish a connection to the network or the Internet, or is encountering a problem. Make sure you have installed AirPort Utility and use it to get information about what might cause the status light to flash amber. See “If Your Time Capsule Status Light Flashes Amber” on page 27. Solid green Your Time Capsule is on and working properly. If you choose Flash On Activity from the Status Light pop-up menu (in the Base Station pane of AirPort settings in AirPort Utility), the status light may flash green to indicate normal activity. Flashing amber and green There may be a problem starting up. Your Time Capsule will restart and try again.12 Chapter 1 Getting Started What’s Next After you plug in your Time Capsule, use AirPort Utility to set it up to work with your Internet connection, USB printer or hard disk, or an existing network. AirPort Utility is located in the Utilities folder in the Applications folder on a computer using Mac OS X, and in Start > All Programs > AirPort on a computer using Windows XP or Windows Vista. Solid blue Your Time Capsule is ready to allow a wireless client access to the network. See “Allowing Wireless Clients to Access Your Network Without Entering a Password” on page 22. Light Status/description2 13 2 Setting Up Your Time Capsule This chapter provides information and instructions for connecting your Time Capsule to the Internet, and using AirPort Utility to set it up to create or join a wireless network. This chapter provides an overview of connecting your Time Capsule to the Internet, and using the setup assistant in AirPort Utility to set up your network and other features of your Time Capsule. For more information about wireless networking, and for information about the advanced features of AirPort Utility, refer to “Designing AirPort Networks Using AirPort Utility (Mac OS X v10.5 + Windows)” at www.apple.com/support/airport. After you install AirPort Utility from the CD that came with your Time Capsule, you can do most of your network setup and configuration tasks using the setup assistant in AirPort Utility. To set advanced options, choose Manual Setup from the Base Station menu of AirPort Utility. See “Setting Advanced Options” on page 21.14 Chapter 2 Setting Up Your Time Capsule Using Your Time Capsule to Create Your Wireless Network When you set up your Time Capsule to provide network and Internet access, the following computers and devices can access the wireless AirPort network to share files, play games, and use Internet applications such as web browsers and email applications:  Macintosh computers with AirPort or AirPort Extreme Cards  802.11a, 802.11b, 802.11g, and IEEE 802.11n draft specification wireless-equipped computers  Other Wi-Fi devices Computers connected to your Time Capsule using Ethernet can also access the network to share files and connect to the Internet. With Mac OS X v10.5.2 or later you can set up Time Machine to back up all the computers on the network to your Time Capsule. See “Using Time Machine with Your Time Capsule” on page 23 for more information. When you connect a compatible USB printer to your Time Capsule, supported computers on the network (wired and wireless) can print to it.Chapter 2 Setting Up Your Time Capsule 15 Using Time Capsule to create a wireless network To set it up: 1 Connect your DSL or cable modem to your Time Capsule using the Ethernet WAN (<) port. to Internet DSL or cable modem < Internet WAN port Shared printer Time Capsule to USB ports 2.4 or 5 GHz 2.4 GHz 2.4 or 5 GHz16 Chapter 2 Setting Up Your Time Capsule 2 If you plan to share a USB printer on the network, connect it to the Time Capsule USB (d) port or to a USB hub, using a USB cable. 3 Open AirPort Utility (located in the Utilities folder in the Applications folder on a computer using Mac OS X, and in Start > All Programs > AirPort on a computer using Windows), select your Time Capsule, and then click Continue. 4 Follow the onscreen instructions to create a new network. To print from a computer using Mac OS X v10.5: 1 Choose Apple > System Preferences, and then click Print & Fax. 2 Click Add (+) and select your printer from the list. 3 Click the Add button. If your printer isn’t in the list, use the buttons in the toolbar to search for it. To print from a computer using Mac OS X v10.3 or 10.4: 1 Open Printer Setup Utility (located in the Utilities folder in the Applications folder). 2 Select the printer from the list. If the printer isn’t in the list, click Add and choose Bonjour from the pop-up menu, and then select the printer from the list. To print from a computer using Windows XP or Windows Vista: 1 Install Bonjour for Windows from the CD that came with your Time Capsule. 2 Follow the onscreen instructions to connect to your printer. Computers using AirPort or other compatible wireless cards or adapters can connect to the Internet through your Time Capsule. Computers connected to the Time Capsule Ethernet ports can also access the network and connect to the Internet.Chapter 2 Setting Up Your Time Capsule 17 Wireless computers and computers connected to the Ethernet ports can also communicate with each other through your Time Capsule. Using AirPort Utility To set up and configure your Time Capsule, use the setup assistant in AirPort Utility. AirPort Utility is installed on your computer when you install the software from the Time Capsule CD. On a Macintosh computer using Mac OS X v10.4 or later: 1 Open AirPort Utility, located in the Utilities folder in the Applications folder. 2 Select your Time Capsule and click Continue. If you don’t see the Time Capsule you want to configure, click Rescan to scan for available wireless devices, and then select your Time Capsule from the list. 3 Follow the onscreen instructions to set up your Time Capsule and your wireless network. On a computer using Windows XP (with Service Pack 2) or Windows Vista: 1 Open AirPort Utility, located in Start > All Programs > AirPort. 2 Select your Time Capsule and click Continue.18 Chapter 2 Setting Up Your Time Capsule 3 Follow the onscreen instructions to set up your Time Capsule and your wireless network. The AirPort Utility setup assistant asks you questions about the type of network you want to use and the services you want to set up, and helps you enter the appropriate settings. If you’re using your Time Capsule to connect to the Internet, you need a broadband (DSL or cable modem) account with an Internet service provider (ISP), or a connection to the Internet using an existing Ethernet network. If you received specific information from your ISP (such as a static IP address or a DHCP client ID), you may need to enter it in AirPort Utility. Have this information available when you set up your Time Capsule.Chapter 2 Setting Up Your Time Capsule 19 Creating a New Wireless Network You can use the AirPort Utility setup assistant to create a new wireless network. The setup assistant guides you through the steps necessary to name your network, protect your network with a password, and set other options. If you plan to share a USB printer or USB hard disk on your network: 1 Connect the printer or hard disk to the Time Capsule USB (d) port. 2 Open AirPort Utility, located in the Utilities folder in the Applications folder on a Macintosh, or in Start > All Programs > AirPort on a computer using Windows XP. 3 Select your Time Capsule and click Continue. If you don’t see the Time Capsule you want to configure, click Rescan to scan for available wireless devices, and then select your Time Capsule from the list. 4 Follow the onscreen instructions to create a new network. Configuring and Sharing Internet Access If you plan to share your Internet connection with wireless-enabled computers on your network or with computers connected to the Ethernet ports, you need to set up your Time Capsule as an AirPort Base Station. After your Time Capsule is set up, computers access the Internet through the AirPort network. Your Time Capsule connects to the Internet and transmits information to the computers over the wireless network. Before you use AirPort Utility to set up your Time Capsule, connect your DSL or cable modem to the Time Capsule Ethernet WAN (<) port. If you’re connecting your Time Capsule to an Ethernet network that already has Internet access, connect it to the Ethernet network.20 Chapter 2 Setting Up Your Time Capsule Use the AirPort Utility setup assistant to enter your ISP settings and configure how your Time Capsule shares the settings with other computers. 1 Open AirPort Utility, located in the Utilities folder in the Applications folder on a computer using Mac OS X, or in Start > All Programs > AirPort on a computer using Windows XP. 2 Select your Time Capsule and click Continue. If you’re making changes to a Time Capsule that has already been set up, you might have to connect to the network it’s created before making changes to the Time Capsule. To choose the wireless network you want to change on a Macintosh, use the AirPort status menu in the menu bar. On a computer using Windows XP, hold the pointer over the wireless connection icon until you see the network name (SSID), and then choose it from the list if there are multiple networks available. 3 Follow the onscreen instructions to configure and share Internet access on your Time Capsule. AirPort Utility provides a quick and easy way to set up your Time Capsule and network. If you want to set additional options for your network, such as restricting access to your network or setting advanced DHCP options, choose Manual Setup from the Base Station menu of AirPort Utility. Chapter 2 Setting Up Your Time Capsule 21 Setting Advanced Options Use AirPort Utility to set up your Time Capsule manually if you want to set advanced Time Capsule options such as advanced security options, closed networks, DHCP lease time, access control, power controls, user accounts, and more. To set advanced options: 1 Open AirPort Utility, located in the Utilities folder in the Applications folder on a Macintosh, and in Start > All Programs > AirPort on a computer using Windows XP. 2 If there’s more than one wireless device in the list, select the one you want to configure. If you don’t see the Time Capsule you want to configure, click Rescan to scan for available wireless devices, and then select your Time Capsule from the list. If you’re making changes to a Time Capsule that has already been set up, you might have to connect to the network it’s created before making changes to your Time Capsule. To choose the wireless network you want to change, on a Macintosh use the AirPort status menu in the menu bar. On a computer using Windows XP, hold the pointer over the wireless connection icon until you see the network name (SSID), and then choose it from the list if there are multiple networks available. 3 Choose Manual Setup from the Base Station menu. If you’re prompted for a password, enter it. For more about the manual setup features in AirPort Utility, see “Designing AirPort Networks Using AirPort Utility (Mac OS X v10.5 + Windows)” at www.apple.com/ support/airport.22 Chapter 2 Setting Up Your Time Capsule Allowing Wireless Clients to Access Your Network Without Entering a Password If your network is password-protected using WPA Personal or WPA/WPA2 Personal, you can provide wireless clients access to your network without requiring them to enter the network password. When you allow a client access to your network, the client’s name and wireless MAC address (or AirPort ID) are stored in the access control list of AirPort Utility until you remove the client from the list. You can also provide 24 hours of access, after which time the client will no longer be able to access your network. When you give a client access to your wireless network, the client doesn’t need to enter the network password. To allow a client to access your network without entering the network password: 1 Open AirPort Utility, select your Time Capsule, and then choose Manual Setup from the Base Station menu. Enter the password if necessary. 2 Choose Add Wireless Clients from the Base Station menu. 3 Select how you want the client to access the network:  Select PIN to enter the eight-digit number provided by the client requesting network access.  Select “First attempt” to allow network access to the first client attempting to join the network. While the Time Capsule waits for a client to join the network, the LED glows blue.Chapter 2 Setting Up Your Time Capsule 23 Select “Limit client’s access to 24 hours” if you want to provide just one day of access to your network. If you don’t select this option, the client will have access until you remove the client from the list. Using Time Machine with Your Time Capsule With the Time Machine application in Mac OS X Leopard you can back up everything on your computer, including your photos, music, movies, and documents. After you set up Time Machine, it automatically backs up your computer on a regular basis. If you’re using Mac OS X v10.5.2 or later, the first time you connect to your Time Capsule, Time Machine asks if you’d like to use it to back up your files. Click “Use as Backup Disk,” and Time Machine takes care of the rest. Use the Time Machine pane of System Preferences in Mac OS X Leopard to set up automatic backups, change to a different backup disk, or adjust other settings. To set up or adjust Time Machine on a computer using Mac OS X Leopard: 1 Choose Apple > System Preferences, and then click Time Machine. 2 Slide the switch to ON. 3 Click Change Disk. 4 Choose your Time Capsule and click “Use for Backup.”24 Chapter 2 Setting Up Your Time Capsule Your first backup with Time Capsule and Time Machine could take overnight or longer, depending on how much data you’re backing up. To speed up the initial backup, connect your Time Capsule to your computer using Ethernet. In each subsequent backup, Time Machine backs up only files that have changed since the previous backup, so the backups don’t take as long. Time Capsule is a great wireless backup solution for portable computers. Since the first backup can take some time, plug your portable into a power adapter—this conserves battery power and guarantees that backups won’t be interrupted. Also, for the best wireless performance, place your portable computer in the same room as your Time Capsule. If you shut down your Mac or put it to sleep during a backup, Time Machine stops the backup and then continues from where it left off after your Mac starts up again. For more information about Time Machine, choose Help > Mac Help from the Finder menu on a computer using Mac OS X Leopard, and then type Time Machine in the search field.3 25 3 Tips and Troubleshooting You can quickly solve most problems with your Time Capsule by following the advice in this chapter. If You Can’t Connect to the Internet  Try connecting to the Internet directly from your computer. If you can’t connect, check to make sure your network settings are correct. If they appear to be correct and you still can’t connect, contact your Internet service provider (ISP).  Make sure you’re connecting to the correct wireless network. If You Forgot Your Network Password or Time Capsule Password You can clear the AirPort network password or Time Capsule password by resetting your Time Capsule. To reset the Time Capsule password: 1 Use something pointed (such as a ballpoint pen) to press and hold down the reset button for one second. Important: If you hold the reset button for more than one second, you may lose your network settings.26 Chapter 3 Tips and Troubleshooting 2 Select your AirPort network.  On a Macintosh, use the AirPort status menu in the menu bar to select the network created by your Time Capsule (the network name doesn’t change).  On a computer using Windows XP, hold the pointer over the wireless connection icon until you see your AirPort network name (SSID), and choose it from the list if there are multiple networks available. 3 Open AirPort Utility (in the Utilities folder in the Applications folder on a Macintosh, and in Start > All Programs > AirPort on a computer using Windows XP). 4 Select your Time Capsule, and then choose Manual Setup from the Base Station menu. 5 Click AirPort in the toolbar, and then click Base Station. 6 Enter a new password for your Time Capsule. 7 Click Wireless and choose an encryption method from the Wireless Security pop-up menu to turn on encryption and activate password protection for your AirPort network. If you turn on encryption, enter a new password for your AirPort network. 8 Click Update to restart your Time Capsule and load the new settings. If Your Time Capsule Isn’t Responding Try unplugging it and plugging it back in. If your Time Capsule stops responding completely, you may need to reset it to the factory default settings. Important: Resetting your Time Capsule to factory default settings erases all of the current settings and resets them to the settings that came with your Time Capsule.Chapter 3 Tips and Troubleshooting 27 To return your Time Capsule to the factory settings: m Use something pointed (such as a ballpoint pen) to press down and hold the reset button until the status light flashes quickly (about 5 seconds). Your Time Capsule resets with the following settings:  Your Time Capsule receives its IP address using DHCP.  The network name is reset to Apple Network XXXXXX (where XXXXXX is replaced with the last six digits of the AirPort ID).  The Time Capsule password is reset to public. If your Time Capsule still isn’t responding, try the following: 1 Unplug your Time Capsule. 2 Use something pointed to press and hold down the reset button while you plug in your Time Capsule. If Your Time Capsule Status Light Flashes Amber The Ethernet cable may not be connected properly, your Time Capsule may be out of range of an AirPort network, or there may be a problem with your Internet service provider. If you’re connected to the Internet with a DSL or cable modem, the modem may have lost its connection to the network or the Internet. Even if the modem seems to be working properly, try disconnecting it from its power supply, waiting a few seconds, and then reconnecting it. Make sure your Time Capsule is connected directly to the modem via Ethernet before reconnecting power to the modem.28 Chapter 3 Tips and Troubleshooting For more information about why the light is flashing, open AirPort Utility, select your Time Capsule, and then choose Manual Setup from the Base Station menu. Click Base Station Status to display information about the flashing light. You can also select “Monitor base station for problems” in AirPort preferences. If the base station has a problem, AirPort Utility opens and walks you through solving the problem. If Your Printer Isn’t Responding If you connected a printer to the USB port on your Time Capsule and the computers on the AirPort network can’t print, try the following: 1 Make sure the printer is plugged in and turned on. 2 Make sure the cables are securely connected to the printer and to the Time Capsule USB port. 3 Make sure the printer is selected in the Printer List window on client computers. On a Macintosh using Mac OS X v10.5 or later:  Choose Apple > System Preferences, and then click Print & Fax.  Click Add (+) and select your printer in the list, and then click Add (+). On a Macintosh using Mac OS X v10.2.7 or later:  Open Printer Setup Utility, located in the Utilities folder in the Applications folder.  If the printer isn’t in the list, click Add.  Choose Bonjour from the pop-up menu, select the printer and click Add (+).Chapter 3 Tips and Troubleshooting 29 On a computer using Windows XP:  Open “Printers and Faxes” from the Start menu.  Select the printer. If the printer isn’t in the list, click Add Printer and then follow the onscreen instructions. 4 Turn off the printer, wait a few seconds, and then turn it back on. Updating AirPort Software Apple periodically updates AirPort software. It is recommended that you update your Time Capsule to use the latest software. You can select “Check for updates when opening AirPort Utility,” or “Check for updates” in AirPort preferences. If you select “Check for updates,” choose an increment of time, such as weekly, from the pop-up menu to automatically check for updates. Time Capsule Placement Considerations The following recommendations can help your Time Capsule achieve the best wireless range and network coverage.  Place your Time Capsule in an open area where there are few obstructions, such as large pieces of furniture or walls. Try to place it away from metallic surfaces.  If you place your Time Capsule behind furniture, keep at least an inch of space between the Time Capsule and the edge of the furniture.  Avoid placing your Time Capsule in areas surrounded by metal surfaces on three or more sides. 30 Chapter 3 Tips and Troubleshooting  If you place your Time Capsule in an entertainment center with your stereo equipment, avoid surrounding your Time Capsule with audio, video, or power cables. Place your Time Capsule so that the cables are to one side. Maintain as much space as possible between your Time Capsule and the cables.  Try to place your Time Capsule at least 25 feet (7.6 meters) from any microwave oven, 2.4 or 5 gigahertz (GHz) cordless phone, and other sources of interference.  Do not place other objects (books, papers, small pets, etc.) on top of the Time Capsule. It may interfere with Time Capsule cooling. Items That Can Cause Interference with AirPort The farther away the interference source, the less likely it is to cause a problem. The following can interfere with AirPort communication:  Microwave ovens  Direct Satellite Service (DSS) radio frequency leakage  The original coaxial cable that came with certain types of satellite dishes. Contact the device manufacturer and obtain newer cables.  Certain electrical devices such as power lines, electrical railroad tracks, and power stations  Cordless telephones that operate in the 2.4 or 5 GHz range. If you have problems with your phone or AirPort communication, change the channel your base station or Time Capsule uses, or change the channel your phone uses.  Nearby base stations using adjacent channels. For example, if base station A is set to channel 1, base station B should be set to channel 6 or 11.4 31 4 Learning More, Service, and Support You can find more information about using your Time Capsule on the web and in onscreen help. Online Resources For the latest information about the Time Capsule, go to www.apple.com/airport. To register your Time Capsule (if you didn’t do it when you installed the software on the Time Capsule CD), go to www.apple.com/register. For AirPort support information, forums with product-specific information and feedback, and the latest Apple software downloads, go to www.apple.com/support/ airport. For support outside of the United States, go to www.apple.com/support, and then choose your country.32 Chapter 4 Learning More, Service, and Support Onscreen Help To learn more about using AirPort Utility with your Time Capsule, open AirPort Utility and choose Help > AirPort Utility Help. Obtaining Warranty Service If your Time Capsule appears to be damaged or doesn’t function properly, please follow the advice in this booklet, the onscreen help, and the online resources. If your Time Capsule still doesn’t function, go to www.apple.com/support for information about getting warranty service. Finding the Serial Number of Your Time Capsule The serial number is printed on the bottom of your Time Capsule.33 Appendix Time Capsule Specifications and Safety Guidelines Time Capsule Specifications  Frequency Band: 2.4 and 5 GHz  Radio Output Power: Up to 23 dBm (nominal)  Standards: 802.11 DSSS 1 and 2 Mbps standard, 802.11a, 802.11b, 802.11g specifications, and a draft 802.11n specification Interfaces  1 RJ-45 10/100/1000Base-T Gigabit Ethernet WAN (<)  3 RJ-45 10/100/1000Base-T Gigabit Ethernet LAN (G)  Universal Serial Bus (USB d) 2.0  802.11 a/b/g/n AirPort Extreme wireless Environmental Specifications  Operating Temperature: 32° F to 95° F (0° C to 35° C)  Storage Temperature: –13° F to 140° F (–25° C to 60° C)  Relative Humidity (Operational): 20% to 80% relative humidity  Relative Humidity (Storage): 10% to 90% relative humidity, noncondensing34 Appendix Time Capsule Specifications and Safety Guidelines Size and Weight  Length: 7.75 inches (197.0 mm)  Width: 7.75 inches (197.0 mm)  Height: 1.43 inches (36.33 mm)  Weight: 3.5 pounds (1.6 kilograms) Hardware Media Access Control (MAC) Addresses The Time Capsule has three hardware addresses printed on the bottom of the case:  AirPort ID: The two addresses used to identify the Time Capsule on a wireless network.  Ethernet ID: You may need to provide this address to your ISP to connect your Time Capsule to the Internet. Using Your Time Capsule Safely  The only way to shut off power completely to your Time Capsule is to disconnect it from the power source.  When connecting or disconnecting your Time Capsule, always hold the plug by its sides. Keep fingers away from the metal part of the plug.  Your Time Capsule should not be opened for any reason, even when it’s unplugged. If your Time Capsule needs service, see “Learning More, Service, and Support” on page 31.  Never force a connector into a port. If the connector and port don’t join with reasonable ease, they probably don’t match. Make sure that the connector matches the port and that you’ve positioned the connector correctly in relation to the port.Appendix Time Capsule Specifications and Safety Guidelines 35 About Operating and Storage Temperatures  When you’re using your Time Capsule, it is normal for the case to get warm. The Time Capsule case functions as a cooling surface that transfers heat from inside the unit to the cooler air outside. Avoid Wet Locations  Keep your Time Capsule away from sources of liquid, such as drinks, washbasins, bathtubs, shower stalls, and so on.  Protect your Time Capsule from direct sunlight and rain or other moisture.  Take care not to spill any food or liquid on your Time Capsule. If you do, unplug it before cleaning up the spill.  Do not use your Time Capsule outdoors. The Time Capsule is an indoor product. Do Not Make Repairs Yourself About Handling Your Time Capsule may be damaged by improper storage or handling. Be careful not to drop your Time Capsule when transporting it. WARNING: To reduce the chance of shock or injury, do not use your Time Capsule in or near water or wet locations. WARNING: Do not attempt to open your Time Capsule or disassemble it. You run the risk of electric shock and voiding the limited warranty. No user-serviceable parts are inside.36 Regulatory Compliance Information Wireless Radio Use This device is restricted to indoor use due to its operation in the 5.15 to 5.25 GHz frequency range to reduce the potential for harmful interference to cochannel Mobile Satellite systems. Cet appareil doit être utilisé à l’intérieur. Exposure to Radio Frequency Energy The radiated output power of this device is well below the FCC and EU radio frequency exposure limits. However, this device should be operated with a minimum distance of at least 20 cm between its antennas and a person’s body and the antennas used with this transmitter must not be colocated or operated in conjunction with any other antenna or transmitter subject to the conditions of the FCC Grant. FCC Declaration of Conformity This device complies with part 15 of the FCC rules. Operation is subject to the following two conditions: (1) This device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. See instructions if interference to radio or television reception is suspected. Radio and Television Interference This computer equipment generates, uses, and can radiate radio-frequency energy. If it is not installed and used properly—that is, in strict accordance with Apple’s instructions—it may cause interference with radio and television reception. This equipment has been tested and found to comply with the limits for a Class B digital device in accordance with the specifications in Part 15 of FCC rules. These specifications are designed to provide reasonable protection against such interference in a residential installation. However, there is no guarantee that interference will not occur in a particular installation. You can determine whether your computer system is causing interference by turning it off. If the interference stops, it was probably caused by the computer or one of the peripheral devices. If your computer system does cause interference to radio or television reception, try to correct the interference by using one or more of the following measures:  Turn the television or radio antenna until the interference stops.  Move the computer to one side or the other of the television or radio.  Move the computer farther away from the television or radio.  Plug the computer into an outlet that is on a different circuit from the television or radio. (That is, make certain the computer and the television or radio are on circuits controlled by different circuit breakers or fuses.) If necessary, consult an Apple Authorized Service Provider or Apple. See the service and support information that came with your Apple product. Or, consult an experienced radio/television technician for additional suggestions. Important: Changes or modifications to this product not authorized by Apple Inc. could void the EMC compliance and negate your authority to operate the product.37 This product was tested for FCC compliance under conditions that included the use of Apple peripheral devices and Apple shielded cables and connectors between system components. It is important that you use Apple peripheral devices and shielded cables and connectors between system components to reduce the possibility of causing interference to radios, television sets, and other electronic devices. You can obtain Apple peripheral devices and the proper shielded cables and connectors through an Apple-authorized dealer. For non-Apple peripheral devices, contact the manufacturer or dealer for assistance. Responsible party (contact for FCC matters only) Apple Inc., Corporate Compliance, 1 Infinite Loop M/S 26-A, Cupertino, CA 95014-2084 Industry Canada Statement This Class B device meets all requirements of the Canadian interference-causing equipment regulations. Cet appareil numérique de la Class B respecte toutes les exigences du Règlement sur le matériel brouilleur du Canada. VCCI Class B Statement Europe—EU Declaration of Conformity For more information, see www.apple.com/euro/ compliance. European Union — Disposal Information This symbol means that according to local laws and regulations your product should be disposed of separately from household waste. When this product reaches its end of life, take it to a collection point designated by local authorities. Some collection points accept products for free. The separate collection and recycling of your product at the time of disposal will help conserve natural resources and ensure that it is recycled in a manner that protects human health and the environment. Disposal and Recycling Information This product has an internal battery. Please dispose of it according to your local environmental laws and guidelines. For information about Apple’s recycling program, go to www.apple.com/environment. California: The coin cell battery in your product contains perchlorates. Special handling and disposal may apply. Refer to www.dtsc.ca.gov/hazardouswaste/ perchlorate. Deutschland: Dieses Gerät enthält Batterien. Bitte nicht in den Hausmüll werfen. Entsorgen Sie dieses Gerätes am Ende seines Lebenszyklus entsprechend der maßgeblichen gesetzlichen Regelungen. Nederlands: Gebruikte batterijen kunnen worden ingeleverd bij de chemokar of in een speciale batterijcontainer voor klein chemisch afval (kca) worden gedeponeerd.38 Taiwan: Singapore Wireless Certification Taiwan Warning Statements Korea Warning Statements © 2009 Apple Inc. All rights reserved. Apple, the Apple logo, AirPort, AirPort Express, AirPort Extreme, Apple TV, Bonjour, iPod, Leopard, Macintosh, Mac OS, and Time Capsule are trademarks of Apple Inc., registered in the U.S. and other countries. Finder, iPhone, and Time Machine are trademarks of Apple Inc. Other product and company names mentioned herein may be trademarks of their respective companies.www.apple.com/airport www.apple.com/support/airport 034-4704-A Printed in XXXX Code Signing GuideContents About Code Signing 4 At a Glance 5 Prerequisites 5 See Also 5 Code Signing Overview 6 The Benefits Of Signing Code 6 Digital Signatures and Signed Code 8 Code Requirements 8 The Role of Trust in Code Signing 9 Code Signing Tasks 11 Obtaining a Signing Identity 11 Adding an Info.plist to Single-File Tools 15 Signing Your Code 17 What to Sign 17 When to Sign 18 Using the codesign Command 18 Using the spctl Tool to Test Code Signing 21 Shipping and Updating Your Product 23 Code Signing Requirement Language 25 Language Syntax 25 Evaluation of Requirements 26 Constants 26 String Constants 26 Integer Constants 27 Hash Constants 27 Variables 27 Logical Operators 27 Comparison Operations 28 Equality 28 Inequality 29 Existence 29 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 2Constraints 29 Identifier 29 Info 30 Certificate 30 Trusted 32 Entitlement 33 Code Directory Hash 33 Requirement Sets 34 Document Revision History 36 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 3 ContentsCode signing is a security technology, used in OS X, that allows you to certify that an app was created by you. Once an app is signed, the system can detect any change to the app—whether the change is introduced accidentally or by malicious code. Hash Message digest Digital signature Encrypt Signer’s certificate Code-signed data Signer’s private key 10101100100 10111100001 Data Duis autem vel eum vulputate velit esse molestie consequat, vel illum dolore. 00/00/00 Lorem Ipsum Lorem Ipsum Dolor Lorem Ipsum Dolor Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis. Users appreciate code signing. After installing a new version of a code-signed app, a user is not bothered with alerts asking again for permission to access the keychain or similar resources. As long as the new version uses the same digital signature, OS X can treat the new app exactly as it treated the previous one. Other OS X security features, such as App Sandbox and parental controls, also depend on code signing. In most cases, you can rely on Xcode’s automatic code signing (described in Tools Workflow Guide for Mac ), which requires only that you specify a code signing identity in the build settingsfor your project. This document is for readers who must go beyond automatic code signing—perhaps to troubleshoot an unusual problem, or to incorporate the codesign(1) tool into a build system. 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 4 About Code SigningAt a Glance The elements of code signing include code signatures, code signing identities, code signing certificates, and security trust policies. Be sure to understand these concepts if you need to perform code signing outside of Xcode. Relevant chapter: “Code Signing Overview” (page 6) Before you can sign code, you must obtain or create a code signing identity. You then sign your code and prepare it for distribution. Relevant chapter: “Code Signing Tasks” (page 11) To specify recommended criteria for verifiers to use when evaluating your app’s code signature, you use a requirements language specific to the codesign(1) and csreq(1) commands. You then save your criteria to a binary file as part of your Xcode project. Relevant chapter: “Code Signing Requirement Language” (page 25) Prerequisites Read Security Overview to understand the place of code signing in the OS X security picture. See Also For descriptions of the command-line toolsfor performing code signing,see the codesign(1) and csreq(1) man pages. About Code Signing At a Glance 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 5Code signing is a security technique that can be used to ensure code integrity, to determine who developed a piece of code, and to determine the purposes for which a developer intended a piece of code to be used. Although the code signing system performs policy checks based on a code signature, it is up to the caller to make policy decisions based on the results of those checks. When it is the operating system that makes the policy checks, whether your code will be allowed to run in a given situation depends on whether you signed the code and on the requirements you included in the signature. This chapter describes the benefits of signing code and introduces some of the basic concepts you need to understand in order to carry out the code signing process. Before you read this chapter, you should be familiar with the concepts described in Security Overview. The Benefits Of Signing Code When a piece of code has been signed, it is possible to determine reliably whether the code has been modified by someone other than the signer. The system can detect such alternation whether it was intentional (by a malicious attacker, for example) or accidental (as when a file gets corrupted). In addition, through signing, a developer can state that an app update is valid and should be considered by the system as the same app as the previous version. For example,suppose a user grantsthe SurfWriter app permission to access a keychain item. Each time SurfWriter attempts to access that item, the system must determine whether it is indeed the same app requesting access. If the app is signed, the system can identify the app with certainty. If the developer updates the app and signs the new version with the same unique identifier, the system recognizes the update as the same app and gives it access without requesting verification from the user. On the other hand, if SurfWriter is corrupted or hacked, the signature no longer matches the previous signature; the system detects the change and refuses access to the keychain item. Similarly, if you use Parental Controls to prevent your child from running a specific game, and that game has been signed by its manufacturer, your child cannot circumvent the control by renaming or moving files. Parental Controls uses the signature to unambiguously identify the game regardless of its name, location, or version number. All sorts of code can be signed, including tools, applications, scripts, libraries, plug-ins, and other “code-like” data. 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 6 Code Signing OverviewCode signing has three distinct purposes. It can be used to: ● ensure that a piece of code has not been altered ● identify code as coming from a specific source (a developer or signer) ● determine whether code is trustworthy for a specific purpose (for example, to access a keychain item). To enable signed code to fulfill these purposes, a code signature consists of three parts: ● A seal, which is a collection of checksums or hashes of the various parts of the code, such as the identifier, the Info.plist, the main executable, the resource files, and so on. The seal can be used to detect alterations to the code and to the app identifier. ● A digital signature, which signs the seal to guarantee its integrity. The signature includes information that can be used to determine who signed the code and whether the signature is valid. ● A unique identifier, which can be used to identify the code or to determine to which groups or categories the code belongs. This identifier can be derived from the contents of the Info.plist for the app, or can be provided explicitly by the signer. For more discussion of digital signatures, see the following section, “Digital Signatures and Signed Code.” To learn more about how a code signature is used to determine the signed code’s trustworthiness for a specific purpose, see “Code Requirements” (page 8). Note that code signing deals primarily with running code. Although it can be used to ensure the integrity of stored code (on disk, for example), that's a secondary use. To fully appreciate the uses of code signing, you should be aware of some things that signing cannot do: ● It can’t guarantee that a piece of code is free of security vulnerabilities. ● It can’t guarantee that an app will not load unsafe or altered code—such as untrusted plug-ins—during execution. ● It is not a digital rights management (DRM) or copy protection technology. Although the system could determine that a copy of your app had not been properly signed by you, or that its copy protection had been hacked, thus making the signature invalid, there is nothing to prevent a user from running the app anyway. Code Signing Overview The Benefits Of Signing Code 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 7Digital Signatures and Signed Code As explained in Security Overview, a digital signature uses public key cryptography to ensure data integrity. Like a signature written with ink on paper, a digital signature can be used to identify and authenticate the signer. However, a digital signature is more difficult to forge, and goes one step further: it can ensure that the signed data has not been altered. This is somewhat like designing a paper check or money order in such a way that if someone alters the written amount of money, a watermark with the text “Invalid” becomes visible on the paper. To create a digitalsignature, the signing software computes a special type of checksum called a hash (or digest) based on a piece of data or code and encrypts that hash with the signer’s private key. This encrypted hash is called a signature. To verify that signature, the verifying software computes a hash of the data or code. It then uses the signer’s public key to decrypt the signature, thus obtaining the original hash as computed by the signer. If the two hashes match, the data has not been modified since it was signed by someone in possession of the signer’s private key. Signed code contains several digital signatures: ● If the code is universal, the object code for each slice (architecture) is signed separately. This signature is stored within the binary file itself. ● Various components of the application bundle (such as the Info.plist file, if there is one) are also signed. These signatures are stored in a file called _CodeSignature/CodeResources within the bundle. Code Requirements It is up to the system or program that is launching or loading signed code to decide whether to verify the signature and, if it does, to determine how to evaluate the results of that verification. The criteria used to evaluate a code signature are called code requirements. The signer can specify requirements when signing the code; such requirements are referred to as internal requirements. A verifier can read any internal requirements before deciding how to treat signed code. However, it is up to the verifier to decide what requirements to use. For example, Safari could require a plug-in to be signed by Apple in order to be loaded, regardless of whether that plug-in’s signature included internal requirements. One major purpose of code signatures is to allow the verifier to identify the code (such as a program, plug-in, or script) to determine whether it is the same code the verifier has seen before. The criteria used to make this determination are referred to asthe code’s designated requirement. For example, the designated requirement for Apple Mail might be "was signed by Apple and the identifier is com.apple.Mail". Code Signing Overview Digital Signatures and Signed Code 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 8To see how this works in practice, assume the user has granted permission to the Apple Mail application to access a keychain item. The keychain uses Mail’s designated requirement to identify it: the keychain records the identifier (com.apple.Mail) and the signer of the application (Apple) to identify the program allowed to access the keychain item. Whenever Mail attempts to access this keychain item, the keychain looks at Mail’s signature to make sure that the program has not been corrupted, that the identifier is com.apple.Mail, and that the program wassigned by Apple. If everything checks out, the keychain gives Mail accessto the keychain item. When Apple issues a new version of Mail, the new version includes a signature, signed by Apple, that identifies the application as com.apple.Mail. Therefore, when the user installs the new version of Mail and it attempts to access the keychain item, the keychain recognizes the updated version as the same program and does not prompt the user for verification. Architecturally, a code requirement is a script, written in a dedicated language, that describes conditions (restrictions) the code mustsatisfy to be acceptable forsome purpose. It is up to you whether to specify internal requirements when you sign code. The program identifier or the entire designated requirement can be specified by the signer, or can be inferred by the codesign tool at the time of signing. In the absence of an explicitly specified designated requirement, the codesign utility typically builds a designated requirement from the name of the program found in its Info.plist file and the chain of signatures securing the code signature. Note that validation of signed code against a set of requirements is performed only when the system or some other program needs to determine whether it is safe to trust that code. For example, unsigned code injected into an application through a buffer overflow can still execute because it was not part of the application at launch time. Similarly, an app with an invalid code identifier may still run (depending on policy), but does not get automatic access to keychain items created by previous versions of the app. The Role of Trust in Code Signing Trust is determined by policy. A security trust policy determines whether a particular identity should be accepted for allowing something, such as access to a resource or service. Various parts of OS X have different policies, and make this determination differently. For example, a specialized client application might include a set of root certificatesthat it trusts when communicating with a specific set ofservers. However, these root certificates would not be trusted if those same servers were accessed using a web browser. In much the same way, many parts of OS X (the OS X keychain and parental controls, for example) do not care what entity signed an application; they care only whether the signer has changed since the last time the signature was checked. They use the code signature’s designated requirement for this purpose. Code Signing Overview The Role of Trust in Code Signing 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 9Other parts of OS X constrain acceptable signatures to only those drawn from certificate authorities (root certificates) that are trusted anchors on the system performing the validation. For those checks, the nature of the identity used matters. The Application Firewall is one example of this type of policy. Self-signed identities and self-created certificate authorities do not work for these purposes unless the user has explicitly told the operating system to trust the certificates. You can modify the code signing polices of OS X with the spctl(8) command. Code Signing Overview The Role of Trust in Code Signing 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 10This chapter gives procedures and examplesfor the code signing process. It covers what you need to do before you begin to sign code, how to sign code, and how to ship the code you signed. Obtaining a Signing Identity To sign code, you need a code signing identity, which is a private key plus a digital certificate. The digital certificate must have a usage extension that enables it to be used for signing and it must contain the public key that corresponds to the private key. You can use more than one signing identity, each for its own purpose, such as one to be used for beta seeds and one for final, released products. However, most organizations use only one identity. You can obtain two types of certificates from Apple using the developer portal: Developer ID certificates (for public distribution) and distribution certificates (for submitting to the Mac App Store). To learn more about this, read Tools Workflow Guide for Mac . Note: Apple uses the industry-standard form and format of code signing certificates. Therefore, if your company already has a third-party signing identity that you use to sign code on other systems, you can use it with the OS X codesign command. Similarly, if your company is a certificate issuing authority, contact your IT department to find out how to get a signing certificate issued by your company. If you do not have an existing identity, you should first create one using the Certificate Assistant, which is provided as part of the Keychain Access application. This tool creates a public key, puts it into your keychain, and optionally can produce a certificate signing request that you can then send to Apple (or another certificate authority). The certificate authority then sends you a certificate that, in combination with your private key, completes your digital identity. To import a signing certificate with Keychain Access 1. In Keychain Access (available in /Applications/Utilities), choose File > Import Items. 2. Choose a destination keychain for the identity. 3. Choose the certificate file. 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 11 Code Signing Tasks4. Click Open. Note: If the original private key is not already in your keychain (for example, if you are moving from one development machine to another), you must also import the private key in the same way. Before you obtain a code signing identity and sign your code, consider the following points: ● Do not ship applications signed by self-signed certificates. A self-signed certificate created with the Certificate Assistant is not recognized by users’ operating systems as a valid certificate for any purpose other than validating the designated requirement of your signed code. Because a self-signed certificate has not been signed by a recognized root certificate authority, the user can only verify that two versions of your application came from the same source; they cannot verify that your company is the true source of the code. For more information about root authorities, see “Security Concepts”. ● Depending on your company’s internal policies, you might have to involve your company’s Build and Integration, Legal, and Marketing departments in decisions about what sort of signing identity to use and how to obtain it. You should start this process well in advance of the time you need to actually sign the code for distribution to customers. ● Any signed version of your code that gets into the hands of users will appear to have been endorsed by your company for use. Therefore, you might not want to use your “final” signing identity to sign code that is still in development. ● A signing identity, no matter how obtained, is completely compromised if it is ever out of the physical control of whoever is authorized to sign the code. That means that the signing identity’s private key must never, under any circumstances, be given to end users, and should be restricted to one or a small number of trusted persons within your company. Before obtaining a signing identity and proceeding to sign code, you must determine who within your company will possess the identity, who can use it, and how it will be kept safe. For example, if the identity must be used by more than one person, you can keep it in the keychain of a secure computer and give the password of the keychain only to authorized users, or you can put the identity on a smart card to which only authorized users have the PIN. ● A self-signed certificate created by the Certificate Assistant is adequate for internal testing and development, regardless of what procedures you put in place to sign released products. To use the Certificate Assistant to create a self-signed signing identity 1. Open Applications > Utilities > Keychain Access. Code Signing Tasks Obtaining a Signing Identity 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 122. From the Keychain Access menu, choose Certificate Assistant > Create a Certificate. 3. Fill in a name for the certificate. This name appears in the Keychain Access utility as the name of the certificate. 4. Choose Self Signed Root from the Type popup menu. Code Signing Tasks Obtaining a Signing Identity 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 135. Check the Let me override defaults checkbox. Click Continue. 6. Specify a serial number for the certificate. Any number will do as long as you have no other certificate with the same name and serial number. Code Signing Tasks Obtaining a Signing Identity 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 147. Choose Code Signing from the Certificate Type popup menu. Click Continue. 8. Fill in the information for the certificate. Click Continue. 9. Accept the defaults for the rest of the dialogs. Adding an Info.plist to Single-File Tools As discussed in “Code Requirements” (page 8), the system often uses the Info.plist file of an application bundle to determine the code’s designated requirement. Although single-file tools don’t normally have an Info.plist, you can add one. To do so, use the following procedure: 1. Add an Info.plist file to your project (including adding it to your source control). 2. Make sure the Info.plist file has the following keys: ● CFBundleIdentifier ● CFBundleName Code Signing Tasks Adding an Info.plist to Single-File Tools 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 153. The value for CFBundleIdentifier is used asthe default unique name of your program for Code Signing purposes. Because the CFBundleIdentifier value is also used when your application accessesresources in the application bundle, it may sometimes be necessary to use a non-unique CFBundleIdentifier value for a helper. If you do this, you must provide a different, unique identifier for code signing purposes by passing the -i or --identifier flag to the codesign command. The identifier used for signing must be globally unique. To ensure uniqueness, you should include your company’s name in the value. The usual form for this identifier is a hierarchical name in reverse DNS notation,starting with the top level domain, followed by the company name, followed by the organization within the company, and ending with the product name. For example, the CFBundleIdentifier value for the codesign command is com.apple.security.codesign. 4. The value for CFBundleName shows up in system dialogs asthe name of your program,so itshould match your marketing name for the product. 5. Add the following arguments to your linker flags: -sectcreate __TEXT __info_plist Info.plist_path where Info.plist_path is the complete path of the Info.plist file in your project. In Xcode, for example, you would add these linker flags to the OTHER_LDFLAGS build variable (Other Linker Flags in the target’s build rules). For example, here are the contents of the Info.plist file for the codesign command: CFBundleDevelopmentRegion English CFBundleIdentifier com.apple.security.codesign CFBundleInfoDictionaryVersion 6.0 CFBundleName codesign CFBundleVersion 0.3 Code Signing Tasks Adding an Info.plist to Single-File Tools 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 16Signing Your Code You use the codesign command to sign your code. This section discusses what to sign and gives some examples of the use of codesign. See the codesign(1) manual page for a complete description of its use. What to Sign You should sign every executable in your product, including applications, tools, hidden helper tools, utilities and so forth. Signing an application bundle covers its resources, but not its subcomponents such as tools and sub-bundles. Each of these must be signed independently. If your application consists of a big UI part with one or more little helper tools that try to present a single face to the user, you can make them indistinguishable to code signing by giving them all the exact same code signing identifier. (You can do that by making sure that they all have the same CFBundleIdentifier value in their Info.plist, or by using the -i option in the codesign command, to assign the same identifier.) In that case, all your program components have access to the same keychain items and validate as the same program. Do this only if the programs involved are truly meant to form a single entity, with no distinctions made. A universal binary (bundle or tool) automatically has individual signatures applied to each architecture component. These are independent, and usually only the native architecture on the end user'ssystem is verified. In the case of installer packages (.pkg and .mpkg bundles), everything is implicitly signed: The CPIO archive containing the payload, the CPIO archive containing install scripts, and the bill of materials (BOM) each have a hash recorded in the XAR header, and that header in turn is signed. Therefore, if you modify an install script (for example) after the package has been signed, the signature will be invalid. You may also want to sign your plug-ins and libraries. Although this is not currently required, it will be in the future, and there is no disadvantage to having signatures on these components. Important: When code signing a framework, you must sign a particular version of the framework, not the framework as a whole. For example: codesign -s my-signing-identity ../MyCustomFramework/Versions/A Depending on the situation, codesign may add to your Mach-O executable file, add extended attributes to it, or create new files in your bundle's Contents directory. None of your other files is modified. Code Signing Tasks Signing Your Code 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 17When to Sign You can run codesign at any time on any system running OS X v10.5 or later, provided you have access to the signing identity. You can run it from a shell script phase in Xcode if you like, or as a step in your Makefile scripts, or anywhere else you find suitable. Signing is typically done as part of the product mastering process, after quality assurance work has been done. Avoid signing pre-final copies of your product so that no one can mistake a leaked or accidentally released incomplete version of your product for the real thing. Your final signing must be done after you are done building your product, including any post-processing and assembly of bundle resources. Code signing detects any change to your program after signing, so if you make any changes at all after signing, your code will be rejected when an attempt is made to verify it. Sign your code before you package the product for delivery. Because each architecture component is signed independently, it is all right to perform universal-binary operations (such as running the lipo command) on signed programs. The result will still be validly signed as long as you make no other changes. Using the codesign Command The codesign command is fully described in the codesign(1) manual page. This section provides some examples of common uses of the command. Note that your signing identity must be in a keychain for these commands to work. Signing Code To sign the code located at , using the signing identity , use the following command: codesign -s … The value may be a bundle folder or a specific code binary. See “What to Sign” (page 17) for more details. The identity can be named with any (case sensitive) substring of the certificate's common name attribute, as long as the substring is unique throughout your keychains. (Signing identities are discussed in “Obtaining a Signing Identity” (page 11).) As is typical of Unix-style commands, this command gives no confirmation of success. To get some feedback, include the -v option: codesign -s -v … Code Signing Tasks Signing Your Code 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 18Use the -r option to specify an internal requirement. With this option you can specify a text file containing the requirements, a precompiled requirements binary, or the actual requirement text prefixed with an equal sign (=). For example, to add an internal requirement that all libraries be signed by Apple, you could use the following option: -r="library => anchor apple" The code requirement language is described in “Code Signing Requirement Language” (page 25). If you have built your own certificate hierarchy (perhaps using Certificate Assistant—see “Obtaining a Signing Identity” (page 11)), and want to use your certificate’s anchor to form a designated requirement for your program, you could use the following command: codesign -s signing-identity -r="designated => anchor /my/anchor/cert and identifier com.mycorp.myprog" Note that the requirement source language accepts either an SHA1 hash of a certificate (for example H"abcd....") or a path to the DER encoded certificate in a file. It does not currently accept a reference to the certificate in a keychain, so you have to export the certificate before executing this command. You can also use the csreq command to write the requirements out to a file, and then use the path to that file as the input value for the -r option in the codesign command. See the manual page for csreq(1) for more information on that command. Here are some other samples of requirements: ● anchor apple –the code is signed by Apple ● anchor trusted –the anchor is trusted (for code signing) by the system ● certificate leaf = /path/to/certificate –the leaf (signing) certificate is the one specified ● certificate leaf = /path/to/certificate and identifier "com.mycorp.myprog" –the leaf certificate and program identifier are as specified ● info[mykey] = myvalue – the Info.plist key mykey exists and has the value myvalue Except for the explicit anchor trusted requirement, the system does not consult its trust settings database when verifying a code requirement. Therefore, as long as you don’t add this designated requirement to your code signature, the anchor certificate you use for signing your code does not have to be introduced to the user’s system for validation to succeed. Code Signing Tasks Signing Your Code 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 19Adding Entitlements for Sandboxing If you want to enable App Sandbox for an application, you must add an entitlement property list during the signing process. To do this, add the --entitlements flag and an appropriate property list. For example: codesign --entitlements /path/to/entitlements.plist -s … For a list of entitlement keys that can appear in the entitlement property list, see Entitlement Key Reference . Verifying Code To verify the signature on a signed binary, use the -v option with no other options: codesign -v … This checks that the code binaries at are actually signed, that the signature is valid, that all the sealed components are unaltered, and that the whole thing passes some basic consistency checks. It does not by default check that the code satisfies any requirements except its own designated requirement. To check a particular requirement, use the -R option. For example, to check that the Apple Mail application is identified as Mail,signed by Apple, and secured with Apple’srootsigning certificate, you could use the following command: codesign -v -R="identifier com.apple.mail and anchor apple" /Applications/Mail.app Note that, unlike the -r option, the -R option takes only a single requirement rather than a requirements collection (no => tags). Add one or more additional -v options to get details on the validation process. If you pass a number rather than a path to the verify option, codesign takes the number to be the process ID (pid) of a running process, and performs dynamic validation instead. Getting Information About Code Signatures To get information about a code signature, use the -d option. For example, to output the code signature’s internal requirements to standard out, use the following command: codesign -d -r code-path Note that this option does not verify the signature. Code Signing Tasks Signing Your Code 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 20Using the spctl Tool to Test Code Signing The spctl(8) tool can be used to test your code signatures against various system policies that the user may set. The basic syntax for code signing assessment is shown below: # Assess an application or tool spctl --assess --type execute myTool # Assess an installer package spctl --assess --type install myInstallerPackage.pkg If your application or package signature is valid, these tools exit silently with an exit status of 0. (Type echo $? to display the exit status of the last command.) If the signature is invalid, these tools print an error message and exit with a nonzero exit status. For more detailed information about why the assessment failed, you can add the --verbose flag. For example: spctl --assess --verbose=4 /bin/ls This prints the following output: /bin/ls: accepted source=Apple System To see everything the system has to say about an assessment, pass the --raw option. With this flag, the spctl tool prints a detailed assessment as a property list. To whitelist a program (exactly as if the UI did it), type: spctl --add --label mytest /some/program The --label is an optional tag that you can add to your own rules. This tag allows you to remove the rule easily by typing: spctl --remove --label mytest Note that this removes all rules that match the label, which means that it is a handy way to clean up after testing. You can also temporarily suspend your rules by typing: Code Signing Tasks Using the spctl Tool to Test Code Signing 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 21spctl --disable --label mytest and reenable them later by typing: spctl --enable --label mytest To see a list of the current assessment rules, use the --list flag. For example: spctl --list --type execute The resulting list of rules might look like this: 3[Apple System] P0 allow execute anchor apple 4[Mac App Store] P0 allow execute anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9] exists 5[Developer ID] P0 allow execute anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] exists and certificate leaf[field.1.2.840.113635.100.6.1.13] exists 7[UNLABELED] P0 allow execute [/var/tmp/firefly/RUN-FIREFLY-JOBS/test1.app] cdhash H"f34c03450da53c07ac69282089b68723327f278a" 8[UNLABELED] P0 allow execute [/var/tmp/firefly/RUN-FIREFLY-JOBS/test1.app] identifier "org.tpatko.Run-Firefly-Job-X-Cores" and certificate root = H"5056a3983e3b7f44e17e3db8e483b35b6745b236" Notice that the list above includes a number of predefined rules that describe the handling of certain classes of code. For example, rule 5 captures all applicationssigned by a Developer ID. You can disable those applications by typing: spctl --disable --label "Developer ID" This command tells the system to no longer allow execution of any Developer ID-signed applications that the user has not previously run. This is exactly what happens when you use the preference UI to switch to "Mac App Store only". Each rule in the list has a unique number that can be used to address it. For example, if you type: Code Signing Tasks Using the spctl Tool to Test Code Signing 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 22spctl --list --label "Developer ID" you might get a list of rules that looks like this: 5[Developer ID] P0 allow execute anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] exists and certificate leaf[field.1.2.840.113635.100.6.1.13] exists 6[Developer ID] P0 allow install anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] exists and certificate leaf[field.1.2.840.113635.100.6.1.14] exists Notice that there are separate rules for execution (5) and installation (6), and you can enable and disable them separately. For example, to enable installation of new applications signed with a Developer ID, you can type: spctl --enable --rule 6 Finally, spctl allows you to enable or disable the security assessment policy subsystem. By default, assessment isturned off, which meansthat missing or invalid code signatures do not prevent an application from launching. However, it is strongly recommended that you test your application with assessment enabled to ensure that your application works correctly. To enable or disable assessment, issue one of the following commands. sudo spctl --master-enable # enables assessment sudo spctl --master-disable # disables assessment spctl --status # shows whether assessment is enabled For more information, see the manual page for spctl(8). Shipping and Updating Your Product The only thing that matters to the code signing system is that the signed code installed on the user’s system identical to the code that you signed. It does not matter how you package, deliver, or install your product as long as you don’t introduce any changesinto the product. Compression, encoding, encrypting, and even binary patching the code are all right as long as you end up with exactly what you started with. You can use any installer you like, as long as it doesn't write anything into the product as it installs it. Drag-installs are fine as well. Code Signing Tasks Shipping and Updating Your Product 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 23When you have qualified a new version of your product, sign it just as you signed the previous version, with the same identifier and the same designated requirement. The user’s system will consider the new version of your product to be the same program as the previous version. In particular, the keychain will not distinguish older and newer versions of your program aslong as both were signed and the unique Identifier hasn't changed. You can take a partial-update approach to revising your code on the user’s system. To do so, sign the new version as usual, then calculate the differences between the new and the old signed versions, and transmit the differences. Because the differences include the new signature data, the result of installing the changes on the end-user's system will be the newly signed version. You cannot patch a signed application in the field. If you do so, the system will notice that the application has changed and will invalidate the signature, and there is no way to re-validate or resign the application in the field. Code Signing Tasks Shipping and Updating Your Product 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 24When you use the codesign command to sign a block of code, you can specify internal requirements; that is, the criteria that you recommend should be used to evaluate the code signature. It is up to the verifier to decide whether to apply the internal requirements or some other set of requirements when deciding how to treat the signed code. You use the code requirement language described in this chapter when specifying requirementsto the codesign or csreq command (see the manual pagesfor codesign(1) and csreq(1)). This chapter describes the requirement language source code. You can compile a set of requirements and save them in binary form using the csreq command. You can provide requirements to the codesign command either as source code or as a binary file. Both the codesign and csreq commands can convert a binary requirement set to text. Although there is some flexibility in the source code syntax (for example, quotes can always be used around string constants but are not always required), conversion from binary to text always uses the same form: ● Parentheses are placed (usually only) where required to clarify operator precedence. ● String constants are quoted (usually only) where needed. ● Whether originally specified as constants or through file paths, certificate hashes are always returned as hash constants. ● Comments in the original source are not preserved in the reconstructed text. Language Syntax Some basic features of the language syntax are: ● Expressions use conventional infix notation (that is, the operator is placed between the two entities being acted on; for example quantity < constant). ● Keywords are reserved, but can be quoted to be included as part of ordinary strings. ● Comments are allowed in C, Objective C, and C++. ● Unquoted whitespace is allowed between tokens, but strings containing whitespace must be quoted. ● Line endings have no special meaning and are treated as whitespace. 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 25 Code Signing Requirement LanguageEvaluation of Requirements A requirement constitutes an expression without side effects. Each requirement can have any number of subexpressions, each of which is evaluated with a Boolean (succeed-fail) result. There is no defined order of evaluation. The subexpressions are combined using logical operators in the expression to yield an overall Boolean result for the expression. Depending on the operators used, an expression can succeed even if some subexpressions fail. For example, the expression anchor apple or anchor = "/var/db/yourcorporateanchor.cert" succeeds if either subexpression succeeds—that is, if the code was signed either by Apple or by your company—even though one of the subexpressions is sure to fail. If an error occurs during evaluation, on the other hand, evaluation stops immediately and the codesign or csreq command returns with a result code indicating the reason for failure. Constants Thissection describesthe use ofstring, integer, hash-value, and binary constantsin the code signing requirement language. String Constants String constants must be enclosed by double quotes (" ") unless the string contains only letters, digits, and periods (.), in which case the quotes are optional. Absolute file paths, which start with a slash, do not require quotes unless they contain spaces. For example: com.apple.mail //no quotes are required "com.apple.mail" //quotes are optional "My Company's signing identity" //requires quotes for spaces and apostrophe /Volumes/myCA/root.crt //no quotes are required "/Volumes/my CA/root.crt" //space requires quotes "/Volumes/my_CA/root.crt" //underscore requires quotes It’s never incorrect to enclose the string in quotes—if in doubt, use quotes. Use a backslash to “escape” any character. For example: Code Signing Requirement Language Evaluation of Requirements 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 26"one \" embedded quote" //one " embedded quote "one \\ embedded backslash" //one \ embedded backslash There is nothing special about the single quote character ('). Integer Constants Integer constants are written as decimal constants are in C. The language does not allow radix prefixes (such as 0x) or leading plus or minus (+ or -) signs. Hash Constants Hash values are written either as a hexadecimal number in quotes preceded by an H, or as a path to a file containing a binary certificate. If you use the first form, the number must include the exact number of digits in the hash value. A SHA-1 hash (the only kind currently supported) requires exactly 40 digits; for example: H"0123456789ABCDEFFEDCBA98765432100A2BC5DA" You can use either uppercase or lowercase letters (A..F or a..f) in the hexadecimal numbers. If you specify a file path, the compiler readsthe binary certificate and calculatesthe hash for you. The compiled version of the requirement code includes only the hash; the certificate file and the path are not retained. If you convert the requirement back to text, you get the hexadecimal hash constant. The file path must point to a file containing an X.509 DER encoded certificate. No container forms (PKCS7, PKCS12) are allowed, nor is the OpenSSL "PEM" form supported. Variables There are currently no variables in the requirement language. Logical Operators The requirement language includes the following logical operators, in order of decreasing precedence: ● ! (negation) ● and (logical AND) ● or (logical OR) Code Signing Requirement Language Variables 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 27These operators can be used to combine subexpressionsinto more complex expressions. The negation operator (!) is a unary prefix operator. The others are infix operators. Parentheses can be used to override the precedence of the operators. Because the language is free of side effects, evaluation order of subexpressions is unspecified. Comparison Operations The requirement language includes the following comparison operators: ● = (equals) ● < (less than) ● > (greater than) ● <= (less than or equal to) ● >= (greater than or equal to) ● exists (value is present) The value-present (exists) operator is a unary suffix operator. The others are infix operators. There are no operators for non-matches (not equal to, not greater than, and so on). Use the negation operator (!) together with the comparison operators to make non-match comparisons. Equality All equality operations compare some value to a constant. The value and constant must be of the same type: a string matches a string constant, a data value matches a hexadecimal constant. The equality operation evaluates to true if the value exists and is equal to the constant. String matching uses the same matching rules as CFString (see CFString Reference ). In match expressions (see “Info” (page 30), “Part of a Certificate” (page 31), and “Entitlement” (page 33)), substrings of string constants can be matched by using the * wildcard character: ● value = *constant* is true if the value exists and any substring of the value matches the constant; for example: ● thunderbolt = *under* ● thunderbolt = *thunder* ● thunderbolt = *bolt* ● value = constant* is true if the value exists and begins with the constant; for example: Code Signing Requirement Language Comparison Operations 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 28● thunderbolt = thunder* ● thunderbolt = thun* ● value = *constant is true if the value exists and ends with the constant; for example: ● thunderbolt = *bolt ● thunderbolt = *underbolt If the constant is written with quotation marks, the asterisks must be outside the quotes. An asterisk inside the quotation marks is taken literally. For example: ● "ten thunderbolts" = "ten thunder"* is true ● "ten thunder*bolts" = "ten thunder*"* is true ● "ten thunderbolts" = "ten thunder*" is false Inequality Inequality operations compare some value to a constant. The value and constant must be of the same type: a string matches a string constant, a data value matches a hexadecimal constant. String comparisons use the same matching rules as CFString with the kCFCompareNumerically option flag; for example, "17.4" is greater than "7.4". Existence The existence operator tests whether the value exists. It evaluates to false only if the value does not exist at all or is exactly the Boolean value false. An empty string and the number 0 are considered to exist. Constraints Several keywords in the requirement language are used to require that specific certificates be present or other conditions be met. Identifier The expression identifier = constant succeedsif the unique identifierstring embedded in the code signature is exactly equal to constant. The equal sign is optional in identifier expressions. Signing identifiers can be tested only for exact equality; the wildcard character (*) can not be used with the identifier constraint, nor can identifiers be tested for inequality. Code Signing Requirement Language Constraints 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 29Info The expression info [key]match expression succeedsif the value associated with the top-level key in the code’s info.plist file matches match expression , where match expression can include any of the operators listed in “Logical Operators” (page 27) and “Comparison Operations” (page 28). For example: info [CFBundleShortVersionString] < "17.4" or info [MySpecialMarker] exists You must specify key as a string constant. If the value of the specified key is a string, the match is applied to it directly. If the value is an array, it must be an array of strings and the match is made to each in turn, succeeding if any of them matches. Substrings of string constants can be matched by using any match expression (see “Comparison Operations” (page 28)). If the code has no info.plist file, or the info.plist does not contain the specified key, this expression evaluates to false without returning an error. Certificate Certificate constraints refer to certificates in the certificate chain used to validate the signature. Most uses of the certificate keyword accept an integer that indicatesthe position of the certificate in the chain: positive integers count from the leaf (0) toward the anchor. Negative integers count backward from the anchor (-1). For example, certificate 1 is the intermediate certificate that was used to sign the leaf (that is, the signing certificate), and certificate -2 indicates the certificate that was directly signed by the anchor. Note that this convention is the same as that used for array indexing in the Perl and Ruby programming languages: Anchor First intermediate Second intermediate Leaf certificate 3 certificate 2 certificate 1 certificate 0 certificate -1 certificate -2 certificate -3 certificate -4 Other keywords include: Code Signing Requirement Language Constraints 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 30● certificate root—the anchor certificate; same as certificate 0 ● anchor—same as certificate root ● certificate leaf—the signing certificate; same as certificate -1 Note: The short form cert is allowed for the keyword certificate. If there is no certificate at the specified position, the constraint evaluates to false without returning an error. If the code was signed using an ad-hoc signature, there are no certificates at all and all certificate constraints evaluate to false. (An ad-hoc signature is created by signing with the pseudo-identity - (a dash). An ad-hoc signature does not use or record a cryptographic identity, and thusidentifies exactly and only the one program being signed.) If the code was signed by a self-signed certificate, then the leaf and root refer to the same single certificate. Whole Certificate To require a particular certificate to be present in the certificate chain, use the form certificate position = hash or one of the equivalent forms discussed above, such as anchor = hash . Hash constants are described in “Hash Constants” (page 27). For Apple’s own code, signed by Apple, you can use the short form anchor apple For code signed by Apple, including code signed using a signing certificate issued by Apple to other developers, use the form anchor apple generic Part of a Certificate To match a well-defined element of a certificate, use the form certificate position[element]match expression where match expression can include the * wildcard character and any of the operators listed in “Logical Operators” (page 27) and “Comparison Operations” (page 28). The currently supported elements are asfollows: Code Signing Requirement Language Constraints 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 31Note: Case is significant in element names. Element name Meaning Comments subject.CN Subject common name Shown in Keychain Access utility subject.C Subject country name subject.D Subject description subject.L Subject locality subject.O Subject organization Usually company or organization subject.OU Subject organizational unit subject.STREET Subject street address Certificate field by OID To check for the existence of any certificate field identified by its X.509 object identifier (OID), use the form certificate position [field.OID] exists The object identifier must be written in numeric form (x.y.z ...) and can be the OID of a certificate extension or of a conventional element of a certificate as defined by the CSSM standard (see Chapter 31 in Common Security: CDSA and CSSM, version 2 (with corrigenda) by the Open Group (http://www.opengroup.org/security/cdsa.htm)). Trusted The expression certificate position trusted succeeds if the certificate specified by position is marked trusted for the code signing certificate policy in the system’s Trust Settings database. The position argument is an integer or keyword that indicates the position of the certificate in the chain; see the discussion under “Certificate” (page 30). The expression anchor trusted Code Signing Requirement Language Constraints 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 32succeeds if any certificate in the signature’s certificate chain is marked trusted for the code signing certificate policy in the system’s Trust Settings database, provided that no certificate closer to the leaf certificate is explicitly untrusted. Thus, using the trusted keyword with a certificate position checks only the specified certificate, while using it with the anchor keyword checks all the certificates, giving precedence to the trust setting found closest to the leaf. Important: The syntax anchor trusted is not a synonym for certificate anchor trusted. Whereas the former checks all certificates in the signature, the latter checks only the anchor certificate. Certificates can have per-user trust settings and system-wide trust settings, and trust settings apply to specific policies. The trusted keyword in the code signing requirement language causes trust to be checked for the specified certificate or certificates for the user performing the validation. If there are no settings for that user, then the system settings are used. In all cases, only the trust settings for the code-signing policy are checked. Policies and trust are discussed in Certificate, Key, and Trust Services Programming Guide . Important: If you do not include an expression using the trusted keyword in your code signing requirement, then the verifier does not check the trust status of the certificates in the code signature at all. Entitlement The expression entitlement [key] match expression succeeds if the value associated with the specified key in the signature’s embedded entitlement dictionary matches match expression , where match expression can include the * wildcard character and any of the operators listed in “Logical Operators” (page 27) and “Comparison Operations” (page 28). You must specify key as a string constant. The entitlement dictionary is included in signatures for certain platforms. Code Directory Hash The expression cdhash hash-constant computes a SHA-1 hash of the program’s CodeDirectory resource and succeeds if the value of this hash exactly equals the specified hash constant. Code Signing Requirement Language Constraints 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 33The CodeDirectory resource is the master directory of the contents of the program. It consists of a versioned header followed by an array of hashes. This array consists of a set of optionalspecial hashesfor other resources, plus a vector of hashes for pages of the main executable. The CodeSignature and CodeDirectory resources together make up the signature of the code. You can use the codesign utility with (at least) three levels of verbosity to obtain the hash constant of a program’s CodeDirectory resource: $ codesign -dvvv /bin/ls ... CodeDirectory v=20001 size=257 flags=0x0(none) hashes=8+2 location=embedded CDHash=4bccbc576205de37914a3023cae7e737a0b6a802 ... Because the code directory changes whenever the program changes in a nontrivial way, this test can be used to unambiguously identify one specific version of a program. When the operating system signs an otherwise unsigned program (so that the keychain or Parental Controls can recognize the program, for example), it uses this requirement. Requirement Sets A requirementset is a collection of distinct requirements, each indexed (tagged) with a type code. The expression tag => requirement applies requirement to the type of code indicated by tag , where possible tags are ● host—thisrequirement is applied to the direct host of this code module; each code module in the hosting path can have its own host requirement, where the hosting path isthe chain of code signing hostsstarting with the most specific code known to be running, and ending with the root of trust (the kernel) ● guest—this requirement is applied to each code module that is hosted by this code module ● library—this requirement is applied to all libraries mounted by the signed code ● designated—this is an explicitly specified designated requirement for the signed code; if there is no explicitly specified designated requirement for the code, then there is no designated internal requirement The primary use of requirement sets is to represent the internal requirements of the signed code. For example: Code Signing Requirement Language Requirement Sets 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 34codesign -r='host => anchor apple and identifier com.apple.perl designated => anchor /my/root and identifier com.bar.foo' setsthe internal requirements ofsome code, having a host requirement of anchor apple and identifier com.apple.perl (“I'm a Perlscript and I want to be run by Apple's Perl interpreter”) and an explicit designated requirement of anchor /my/root and identifier com.bar.foo. Note that this command sets no guest or library requirements. You can also put the requirement set in a file and point to the file: codesign -r myrequirements.rqset where the file myrequirements.rqset might contain: //internal requirements host => anchor apple and identifier com.apple.perl //require Apple's Perl interpreter designated => anchor /my/root and identifier com.bar.foo Code Signing Requirement Language Requirement Sets 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 35This table describes the changes to Code Signing Guide . Date Notes 2012-07-23 Added information about new spctl features in OS X v10.8. Added information about Developer IDs and explanation of how to code sign a framework. 2012-05-15 2011-09-28 Revised document to focus exclusively on code signing. Some of the content in this document was previously in Code Signing and Application Sandboxing Guide . 2011-07-11 Added information about application sandboxing. 2009-10-19 Fixed typographical errors. 2009-10-13 Clarified explanation of CFBundleIdentifier and uniqueness. 2008-11-19 Added a chapter describing the code signing requirement language. New document that explains why you should sign your code and provides code signing procedures. 2007-05-15 2012-07-23 | © 2012 Apple Inc. All Rights Reserved. 36 Document Revision HistoryApple Inc. © 2012 Apple Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrievalsystem, or transmitted, in any form or by any means, mechanical, electronic, photocopying, recording, or otherwise, without prior written permission of Apple Inc., with the following exceptions: Any person is hereby authorized to store documentation on a single computer for personal use only and to print copies of documentation for personal use provided that the documentation contains Apple’s copyright notice. No licenses, express or implied, are granted with respect to any of the technology described in this document. Apple retains all intellectual property rights associated with the technology described in this document. This document is intended to assist application developers to develop applications only for Apple-labeled computers. Apple Inc. 1 Infinite Loop Cupertino, CA 95014 408-996-1010 Apple, the Apple logo, Keychain, Logic, Mac, OS X, Safari, Sand, and Xcode are trademarks of Apple Inc., registered in the U.S. and other countries. App Store and Mac App Store are service marks of Apple Inc. Even though Apple has reviewed this document, APPLE MAKES NO WARRANTY OR REPRESENTATION, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THIS DOCUMENT, ITS QUALITY, ACCURACY, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.ASARESULT, THISDOCUMENT IS PROVIDED “AS IS,” AND YOU, THE READER, ARE ASSUMING THE ENTIRE RISK AS TO ITS QUALITY AND ACCURACY. IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL,OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT OR INACCURACY IN THIS DOCUMENT, even if advised of the possibility of such damages. THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORAL OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer, agent, or employee is authorized to make any modification, extension, or addition to this warranty. Some states do not allow the exclusion or limitation of implied warranties or liability for incidental or consequential damages, so the above limitation or exclusion may not apply to you. This warranty gives you specific legal rights, and you may also have other rights which vary from state to state. View Controller Programming Guide for iOSContents About View Controllers 9 At a Glance 10 A View Controller Manages a Set of Views 10 You Manage Your Content Using Content View Controllers 10 Container View Controllers Manage Other View Controllers 10 Presenting a View Controller Temporarily Brings Its View Onscreen 11 Storyboards Link User Interface Elements into an App Interface 11 How to Use This Document 12 Prerequisites 12 See Also 12 View Controller Basics 14 Screens, Windows, and Views Create Visual Interfaces 15 View Controllers Manage Views 17 A Taxonomy of View Controllers 19 Content View Controllers Display Content 19 Container View Controllers Arrange Content of Other View Controllers 21 A View Controller’s Content Can Be Displayed in Many Ways 26 View Controllers Work Together to Create an App’s Interface 28 Parent-Child Relationships Represent Containment 29 Sibling Relationships Represent Peers Inside a Container 29 Presentation Represents a Transient Display of Another Interface 30 Control Flow Represents Overall Coordination Between Content Controllers 31 Storyboards Help You Design Your User Interface 33 Using View Controllers in Your App 35 Working with View Controllers in Storyboards 36 The Main Storyboard Initializes Your App’s User Interface 37 Segues Automatically Instantiate the Destination View Controller 37 Instantiating a Storyboard’s View Controller Programmatically 39 Containers Automatically Instantiate Their Children 41 Instantiating a Non-Storyboard View Controller 41 Displaying a View Controller’s Contents Programmatically 41 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 2Creating Custom Content View Controllers 43 Anatomy of a Content View Controller 43 View Controllers Manage Resources 44 View Controllers Manage Views 45 View Controllers Respond to Events 45 View Controllers Coordinate with Other Controllers 45 View Controllers Often Work with Containers 46 View Controllers May Be Presented by Other View Controllers 46 Designing Your Content View Controller 47 Use a Storyboard to Implement Your View Controller 48 Know When Your Controller Is Instantiated 48 Know What Data Your View Controller Shows and Returns 48 Know What Tasks Your Controller Allows the User to Perform 49 Know How Your View Controller Is Displayed Onscreen 50 Know How Your Controller Collaborates with Other Controllers 50 Examples of Common View Controller Designs 50 Example: Game Title Screen 50 Example: Master View Controller 52 Example: Detail View Controller 53 Example: Mail Compose View Controller 54 Implementation Checklist for Custom Content View Controllers 54 Resource Management in View Controllers 56 Initializing a View Controller 56 Initializing a View Controller Loaded from a Storyboard 56 Initializing View Controllers Programmatically 57 A View Controller Instantiates Its View Hierarchy When Its View is Accessed 57 Loading a View Controller’s View from a Storyboard 59 Creating a View Programmatically 60 Managing Memory Efficiently 61 On iOS 6 and Later, a View Controller Unloads Its Own Views When Desired 63 On iOS 5 and Earlier, the System May Unload Views When Memory Is Low 64 Responding to Display-Related Notifications 66 Responding When a View Appears 66 Responding When a View Disappears 67 Determining Why a View’s Appearance Changed 67 Resizing the View Controller’s Views 69 A Window Sets the Frame of Its Root View Controller’s View 69 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 3 ContentsA Container Sets the Frames of Its Children’s Views 70 A Presented View Controller Uses a Presentation Context 70 A Popover Controller Sets the Size of the Displayed View 70 How View Controllers Participate in the View Layout Process 70 Using View Controllers in the Responder Chain 72 The Responder Chain Defines How Events Are Propagated to the App 72 Supporting Multiple Interface Orientations 74 Controlling What Interface Orientations Are Supported (iOS 6) 75 Declaring a View Controller’s Supported Interface Orientations 75 Dynamically Controlling Whether Rotation Occurs 76 Declaring a Preferred Presentation Orientation 76 Declaring the App’s Supported Interface Orientations 76 Understanding the Rotation Process (iOS 5 and earlier) 77 Declaring the Supported Interface Orientations 77 Responding to Orientation Changes in a Visible View Controller 78 Rotations May Occur When Your View Controller Is Hidden 80 Creating an Alternate Landscape Interface 80 Tips for Implementing Your Rotation Code 82 Accessibility from the View Controller’s Perspective 83 Moving the VoiceOver Cursor to a Specific Element 83 Responding to Special VoiceOver Gestures 84 Escape 85 Magic Tap 85 Three-Finger Scroll 85 Increment and Decrement 86 Observing Accessibility Notifications 86 Presenting View Controllers from Other View Controllers 88 How View Controllers Present Other View Controllers 88 Presentation Styles for Modal Views 91 Presenting a View Controller and Choosing a Transition Style 93 Presentation Contexts Provide the Area Covered by the Presented View Controller 95 Dismissing a Presented View Controller 95 Presenting Standard System View Controllers 96 Coordinating Efforts Between View Controllers 98 When Coordination Between View Controllers Occurs 98 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 4 ContentsWith Storyboards, a View Controller is Configured When It Is Instantiated 99 Configuring the Initial View Controller at Launch 100 Configuring the Destination Controller When a Segue is Triggered 101 Using Delegation to Communicate with Other Controllers 103 Guidelines for Managing View Controller Data 105 Enabling Edit Mode in a View Controller 106 Toggling Between Display and Edit Mode 106 Presenting Editing Options to the User 108 Creating Custom Segues 109 The Life Cycle of a Segue 109 Implementing a Custom Segue 109 Creating Custom Container View Controllers 111 Designing Your Container View Controller 111 Examples of Common Container Designs 113 A Navigation Controller Manages a Stack of Child View Controllers 113 A Tab Bar Controller Uses a Collection of Child Controllers 115 A Page Controller Uses a Data Source to Provide New Children 116 Implementing a Custom Container View Controller 116 Adding and Removing a Child 116 Customizing Appearance and Rotation Callback Behavior 119 Practical Suggestions for Building a Container View Controller 120 Document Revision History 122 Glossary 124 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 5 ContentsFigures, Tables, and Listings View Controller Basics 14 Figure 1-1 A window with its target screen and content views 15 Figure 1-2 Classes in the view system 16 Figure 1-3 A view controller attached to a window automatically adds its view as a subview of the window 17 Figure 1-4 Distinct views managed by separate view controllers 18 Figure 1-5 View controller classes in UIKit 19 Figure 1-6 Managing tabular data 21 Figure 1-7 Navigating hierarchical data 23 Figure 1-8 Different modes of the Clock app 24 Figure 1-9 A master-detail interface in portrait and landscape modes 25 Figure 1-10 Presenting a view controller 27 Figure 1-11 Parent-child relationships 29 Figure 1-12 Sibling relationships in a navigation controller 30 Figure 1-13 Modal presentation by a content view 30 Figure 1-14 The actual presentation is performed by the root view controller. 31 Figure 1-15 Communication between source and destination view controllers 32 Figure 1-16 A storyboard diagram in Interface Builder 33 Using View Controllers in Your App 35 Figure 2-1 A storyboard holds a set of view controllers and associated objects 36 Listing 2-1 Triggering a segue programmatically 38 Listing 2-2 Instantiating another view controller inside the same storyboard 39 Listing 2-3 Instantiating a view controller from a new storyboard 40 Listing 2-4 Installing the view controller as a window’s root view controller 42 Creating Custom Content View Controllers 43 Figure 3-1 Anatomy of a content view controller 44 Figure 3-2 A container view controller imposes additional demands on its children 46 Resource Management in View Controllers 56 Figure 4-1 Loading a view into memory 58 Figure 4-2 Connections in the storyboard 60 Figure 4-3 Unloading a view from memory 65 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 6Table 4-1 Places to allocate and deallocate memory 62 Listing 4-1 Custom view controller class declaration 59 Listing 4-2 Creating views programmatically 61 Listing 4-3 Releasing the views of a view controller not visible on screen 63 Responding to Display-Related Notifications 66 Figure 5-1 Responding to the appearance of a view 66 Figure 5-2 Responding to the disappearance of a view 67 Table 5-1 Methods to call to determine why a view’s appearance changed 68 Using View Controllers in the Responder Chain 72 Figure 7-1 Responder chain for view controllers 73 Supporting Multiple Interface Orientations 74 Figure 8-1 Processing an interface rotation 79 Listing 8-1 Implementing the supportedInterfaceOrientations method 75 Listing 8-2 Implementing the preferredInterfaceOrientationForPresentation method 76 Listing 8-3 Implementing the shouldAutorotateToInterfaceOrientation: method 78 Listing 8-4 Presenting the landscape view controller 81 Accessibility from the View Controller’s Perspective 83 Listing 9-1 Posting an accessibility notification can change the first element read aloud 84 Listing 9-2 Registering as an observer for accessibility notifications 86 Presenting View Controllers from Other View Controllers 88 Figure 10-1 Presented views in the Calendar app. 89 Figure 10-2 Creating a chain of modal view controllers 90 Figure 10-3 Presenting navigation controllers modally 91 Figure 10-4 iPad presentation styles 92 Table 10-1 Transition styles for modal view controllers 93 Table 10-2 Standard system view controllers 96 Listing 10-1 Presenting a view controller programmatically 94 Coordinating Efforts Between View Controllers 98 Listing 11-1 The app delegate configures the controller 100 Listing 11-2 Creating the window when a main storyboard is not being used 101 Listing 11-3 Configuring the destination controller in a segue 102 Listing 11-4 Delegate protocol for dismissing a presented view controller 104 Listing 11-5 Dismissing a presented view controller using a delegate 104 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 7 Figures, Tables, and ListingsEnabling Edit Mode in a View Controller 106 Figure 12-1 Display and edit modes of a view 107 Creating Custom Segues 109 Listing 13-1 A custom segue 110 Creating Custom Container View Controllers 111 Figure 14-1 A container view controller’s view hierarchy contains another controller’s views 112 Figure 14-2 A navigation controller’s view and view controller hierarchy 114 Figure 14-3 A tab bar controller’s view and view controller hierarchy 115 Listing 14-1 Adding another view controller’s view to the container’s view hierarchy 117 Listing 14-2 Removing another view controller’s view to the container’s view hierarchy 117 Listing 14-3 Transitioning between two view controllers 118 Listing 14-4 Disabling automatic appearance forwarding 119 Listing 14-5 Forwarding appearance messages when the container appears or disappears 119 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 8 Figures, Tables, and ListingsView controllers are a vital link between an app’s data and its visual appearance. Whenever an iOS app displays a user interface, the displayed content is managed by a view controller or a group of view controllers coordinating with each other. Therefore, view controllers provide the skeletal framework on which you build your apps. iOS provides many built-in view controller classesto supportstandard user interface pieces,such as navigation and tab bars. As part of developing an app, you also implement one or more custom controllers to display the content specific to your app. 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 9 About View ControllersAt a Glance View controllers are traditional controller objects in the Model-View-Controller (MVC) design pattern, but they also do much more. View controllers provide many behaviors common to all iOS apps. Often, these behaviors are built into the base class. For some behaviors, the base class provides part of the solution and your view controllersubclassimplements custom code to provide the rest. For example, when the user rotatesthe device, the standard implementation attempts to rotate the user interface; however, your subclass decides whether the user interface should be rotated, and, if so, how the configuration of its views should change in the new orientation. Thus, the combination of a structured base class and specific subclassing hooks make it easy for you to customize your app’s behavior while conforming to the platform design guidelines. A View Controller Manages a Set of Views A view controller manages a discrete portion of your app’s user interface. Upon request, it provides a view that can be displayed or interacted with. Often, this view is the root view for a more complex hierarchy of views—buttons, switches, and other user interface elements with existing implementations in iOS. The view controller acts asthe central coordinating agent for this view hierarchy, handling exchanges between the views and any relevant controller or data objects. Relevant chapter: “View Controller Basics” (page 14) You Manage Your Content Using Content View Controllers To present content that is specific to your app, you implement your own content view controllers. You create new view controller classes by subclassing either the UIViewController class or the UITableViewController class, implementing the methods necessary to present and control your content. Relevant chapter: “Creating Custom Content View Controllers” (page 43) Container View Controllers Manage Other View Controllers Container view controllers display content owned by other view controllers. These other view controllers are explicitly associated with the container, forming a parent-child relationship. The combination of container and content view controllers creates a hierarchy of view controller objects with a single root view controller. Each type of container defines its own interface to manage its children. The container’s methods sometimes define specific navigational relationships between the children. A container can also set specific restrictions on the types of view controllers that can be its children. It may also expect the view controllers that are its children to provide additional content used to configure the container. About View Controllers At a Glance 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 10iOS provides many built-in container view controller types you can use to organize your user interface. Relevant chapter: “View Controller Basics” (page 14) Presenting a View Controller Temporarily Brings Its View Onscreen Sometimes a view controller wants to display additional information to the user. Or perhaps it wants the user to provide additional information or perform a task. Screen space is limited on iOS devices; the device might not have enough room to display all the user interface elements at the same time. Instead, an iOS app temporarily displays another view for the user to interact with. The view is displayed only long enough for the user to finish the requested action. To simplify the effort required to implement such interfaces, iOS allows a view controller to present another view controller’s contents. When presented, the new view controller’s views are displayed on a portion of the screen—often the entire screen. Later, when the user completes the task, the presented view controller tells the view controller that presented it that the task is complete. The presenting view controller then dismisses the view controller it presented, restoring the screen to its original state. Presentation behavior must be included in a view controller’s design in order for it to be presented by another view controller. Relevant chapter: “Presenting View Controllers from Other View Controllers” (page 88) Storyboards Link User Interface Elements into an App Interface A user interface design can be very complex. Each view controller references multiple views, gesture recognizers, and other user interface objects. In return, these objects maintain references to the view controller or execute specific pieces of code in response to actions the user takes. And view controllers rarely act in isolation. The collaboration between multiple view controllers also defines other relationships in your app. In short, creating a user interface means instantiating and configuring many objects and establishing the relationships between them, which can be time consuming and error prone. Instead, use Interface Builder to create storyboards. A storyboard holds preconfigured instances of view controllers and their associated objects. Each object’s attributes can be configured in Interface Builder, as can relationships between them. At runtime, your app loads storyboards and uses them to drive your app’s interface. When objects are loaded from the storyboard, they are restored to the state you configured in the storyboard. UIKit also provides methods you can override to customize behaviors that cannot be configured directly in Interface Builder. About View Controllers At a Glance 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 11By using storyboards, you can easily see how the objects in your app’s user interface fit together. You also write less code to create and configure your app’s user-interface objects. Relevant chapter: “View Controller Basics” (page 14), “Using View Controllers in Your App” (page 35) How to Use This Document Start by reading “View Controller Basics” (page 14), which explains how view controllers work to create your app’s interface. Next, read “Using View Controllers in Your App” (page 35) to understand how to use view controllers, both those built into iOS and those you create yourself. When you are ready to implement your app’s custom controllers, read “Creating Custom Content View Controllers” (page 43) for an overview of the tasks your view controller performs, and then read the remaining chapters in this document to learn how to implement those behaviors. Prerequisites Before reading this document, you should be familiar with the content in Start Developing iOS Apps Today and Your Second iOS App: Storyboards. The storyboard tutorial demonstrates many of the techniques described in this book, including the following Cocoa concepts: ● Defining new Objective-C classes ● The role of delegate objects in managing app behaviors ● The Model-View-Controller paradigm See Also For more information about the standard container view controllers provided by UIKit, see View Controller Catalog for iOS . For guidance on how to manipulate views in your view controller, see View Programming Guide for iOS . For guidance on how to handle events in your view controller, see Event Handling Guide for iOS . For more information about the overall structure of an iOS app, see iOS App Programming Guide . About View Controllers How to Use This Document 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 12For guidance on how to configure storyboards in your project, see Xcode 4 User Guide About View Controllers See Also 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 13Appsrunning on iOS–based devices have a limited amount ofscreen space for displaying content and therefore must be creative in how they present information to the user. Apps that have lots of information to display must therefore only show a portion to start, and then show and hide additional content as the user interacts with the app. View controller objects provide the infrastructure for managing content and for coordinating the showing and hiding of it. By having different view controller classes control separate portions of your user interface, you break up the implementation of your user interface into smaller and more manageable units. Before you can use view controllers in your app, you need a basic understanding of the major classes used to display content in an iOS app, including windows and views. A key part of any view controller’simplementation isto manage the views used to display its content. However, managing viewsis not the only job view controllers perform. Most view controllers also communicate and coordinate with other view controllers when transitions occur. Because of the many connections view controllers manage, both looking inward to views and associated objects and looking outward to other controllers, understanding the connections between objects can sometimes be difficult. Instead, use Interface Builder to create storyboards. Storyboards make it easier to visualize the relationships in your app and greatly simplify the effort needed to initialize objects at runtime. 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 14 View Controller BasicsScreens, Windows, and Views Create Visual Interfaces Figure 1-1 shows a simple interface. On the left, you can see the objects that make up this interface and understand how they are connected to each other. Figure 1-1 A window with its target screen and content views There are three major objects at work here: ● A UIScreen object that identifies a physical screen connected to the device. ● A UIWindow object that provides drawing support for the screen. ● A set of UIView objectsto perform the drawing. These objects are attached to the window and draw their contents when the window asks them to. View Controller Basics Screens, Windows, and Views Create Visual Interfaces 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 15Figure 1-2 shows how these classes (and related important classes) are defined in UIKit. Figure 1-2 Classes in the view system Although you don’t need to understand everything about views to understand view controllers, it can be helpful to consider the most salient features of views: ● A view represents a user interface element. Each view covers a specific area. Within that area, it displays contents or responds to user events. ● Views can be nested in a view hierarchy. Subviews are positioned and drawn relative to their superview. Thus, when the superview moves, its subviews move with it. This hierarchy makes it easy to assemble a group of related views by placing them in a common superview. ● Views can animate their property values. When a change to a property value is animated, the value gradually changes over a defined period of time until it reachesthe new value. Changesto multiple properties across multiple views can be coordinated in a single animation. Animation is critically important to iOS app development. Because most apps display only a portion of their contents at one time, an animation allows the user to see when a transition occurred and where the new content came from. An instantaneous transition might confuse the user. ● Views rarely understand the role they play in your app. For example, Figure 1-1 shows a button (titled Hello), which is a special kind of view, known as a control . Controls know how to respond to user interaction in their area, but they don’t know what they control. Instead, when a user interacts with a control, it sends messages to other objects in your app. This flexibility allows a single class (UIButton) to provide the implementation for multiple buttons, each configured to trigger a different action. A complex app needs many views, often assembling them into view hierarchies. It needs to animate subsets of these views onto or off the screen to provide the illusion of a single larger interface. And finally, to keep view classes reusable, the view classes need to be ignorant of the specific role they perform in the app. So the app logic—the brains—needs to be placed somewhere else. Your view controllers are the brains that tie your app’s views together. View Controller Basics Screens, Windows, and Views Create Visual Interfaces 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 16View Controllers Manage Views Each view controller organizes and controls a view; this view is often the root view of a view hierarchy. View controllers are controller objects in the MVC pattern, but a view controller also has specific tasks iOS expects it to perform. These tasks are defined by the UIViewController class that all view controllers inherit from. All view controllers perform view and resource management tasks; other responsibilities depend on how the view controller is used. Figure 1-3 shows the interface from Figure 1-1, but updated here to use a view controller. You never directly assign the views to the window. Instead, you assign a view controller to the window, and the view controller automatically adds its view to the window. Figure 1-3 A view controller attached to a window automatically adds its view as a subview of the window A view controller is careful to load its view only when the view is needed. It can also release the view under certain conditions. For these reasons, view controllers play a key part in managing resources in your app. A view controller is the natural place to coordinate actions of its connected views. For example, when a button is pressed, it sends a message to the view controller. Although the view itself may be ignorant of the task it performs, the view controller is expected to understand what the button press means and how it should respond. The controller might update data objects, animate or change property values stored in its views, or even bring another view controller’s contents to the screen. Usually, each view controller instantiated by your app sees only a subset of your app’s data. It knows how to display that particular set of data, without needing to know about other kinds of data. Thus, an app’s data model, user interface design, and the view controllers you create are all influenced by each other. View Controller Basics View Controllers Manage Views 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 17Figure 1-4 shows an example of an app that managesrecipes. This app displaysthree related but distinct views. The first view lists the recipes that the app manages. Tapping a recipe shows the second view, which describes the recipe. Tapping the recipe’s picture in the detail view shows the third view, a larger version of the photo. Each view is managed by a distinct view controller object whose job isto present the appropriate view, populate the subviews with data, and respond to user interactions within the view hierarchy. Figure 1-4 Distinct views managed by separate view controllers This example demonstrates a few factors common to view controllers: ● Every view is controlled by only one view controller. When a view is assigned to the view controller’s view property, the view controller owns it. If the view is a subview, it might be controlled by the same view controller or a different view controller. You’ll learn more about how to use multiple view controllers to organize a single view hierarchy when you learn about container view controllers. ● Each view controller interacts with a subset of your app’s data. For example, the Photo controller needs to know only the photo to be displayed. ● Because each view controller provides only a subset of the user experience, the view controllers must communicate with each other to make this experience seamless. They may also communicate with other controllers, such as data controllers or document objects. View Controller Basics View Controllers Manage Views 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 18A Taxonomy of View Controllers Figure 1-5 showsthe view controller classes available in the UIKit framework along with other classesimportant to view controllers. For example, the UITabBarController object manages a UITabBar object, which actually displays the tabs associated with the tab bar interface. Other frameworks define additional view controller classes not shown in this figure. Figure 1-5 View controller classes in UIKit View controllers, both those provided by iOS and those you define, can be divided into two general categories—content view controllers and container view controllers—which reflect the role the view controller plays in an app. Content View Controllers Display Content A content view controller presents content on the screen using a view or a group of views organized into a view hierarchy. The controllers described up to this point have been content view controllers. A content view controller usually knows about the subset of the app’s data that is relevant to the role the controller plays in the app. View Controller Basics A Taxonomy of View Controllers 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 19Here are common examples where your app uses content view controllers: ● To show data to the user ● To collect data from the user ● To perform a specific task ● To navigate between a set of available commands or options, such as on the launch screen for a game Content view controllers are the primary coordinating objects for your app because they know the specific details of the data and tasks your app offers the user. Each content view controller object you create is responsible for managing all the views in a single view hierarchy. The one-to-one correspondence between a view controller and the views in its view hierarchy is the key design consideration. You should not use multiple content view controllers to manage the same view hierarchy. Similarly, you should not use a single content view controller object to manage multiple screens’ worth of content. For information about defining your content view controller and implementing the required behaviors, see “Creating Custom Content View Controllers” (page 43). About Table View Controllers Many apps display tabular data. For this reason, iOS provides a built-in subclass of the UIViewController class designed specifically for managing tabular data. This class, UITableViewController, manages a table view and adds support for many standard table-related behaviors such as selection management, row editing, and table configuration. This additional support is there to minimize the amount of code you must write to create and initialize a table-based interface. You can also subclass UITableViewController to add other custom behaviors. View Controller Basics A Taxonomy of View Controllers 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 20Figure 1-6 shows an example using a table view controller. Because it is a subclass of the UIViewController class, the table view controller still has a pointer to the root view of the interface (through its view property) but it also has a separate pointer to the table view displayed in that interface. Figure 1-6 Managing tabular data For more information about table views, see Table View Programming Guide for iOS . Container View Controllers Arrange Content of Other View Controllers A container view controller contains content owned by other view controllers. These other view controllers are explicitly assigned to the container view controller as its children. A container controller can be both a parent to other controllers and a child of another container. Ultimately, this combination of controllers establishes a view controller hierarchy. Each type of container view controller establishes a user interface that its children operate in. The visual presentation of this user interface and the design it imposes on its children can vary widely between different types of containers. For example, here are some ways that different container view controllers may distinguish themselves: ● A container provides its own API to manage its children. ● A container decides whether the children have a relationship between them and what that relationship is. View Controller Basics A Taxonomy of View Controllers 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 21● A container manages a view hierarchy just as other view controllers do. A container can also add the views of any of its children into its view hierarchy. The container decides when such a view is added and how it should be sized to fit the container’s view hierarchy, but otherwise the child view controller remains responsible for the view and its subviews. ● A container might impose specific design considerations on its children. For example, a container might limit its children to certain view controller classes, or it might expect those controllersto provide additional content needed to configure the container’s views. The built-in container classes are each organized around an important user interface principle. You use the user interfaces managed by these containers to organize complex apps. About Navigation Controllers A navigation controller presents data that is organized hierarchically and is an instance of the UINavigationController class. The methods of this class provide support for managing a stack-based collection of content view controllers. Thisstack representsthe path taken by the user through the hierarchical data, with the bottom of the stack reflecting the starting point and the top of the stack reflecting the user’s current position in the data. Figure 1-7 shows screens from the Contacts app, which uses a navigation controller to present contact information to the user. The navigation bar at the top of each page is owned by the navigation controller. The rest of each screen displayed to the user is managed by a content view controller that presentsthe information View Controller Basics A Taxonomy of View Controllers 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 22at that specific level of the data hierarchy. As the user interacts with controls in the interface, those controls tell the navigation controller to display the next view controller in the sequence or dismiss the current view controller. Figure 1-7 Navigating hierarchical data Although a navigation controller’s primary job is to manage its child view controllers, it also manages a few views. Specifically, it manages a navigation bar (that displays information about the user’s current location in the data hierarchy), a button (for navigating back to previous screens), and any custom controls the current view controller needs. You do not directly modify the views owned by the view controller. Instead, you configure the controls that the navigation controller displays by setting properties on each child view controller. For information about how to configure and use navigation controller objects, see “Navigation Controllers”. About Tab Bar Controllers A tab bar controller is a container view controller that you use to divide your app into two or more distinct modes of operation. A tab bar controller is an instance of the UITabBarController class. The tab bar has multiple tabs, each represented by a child view controller. Selecting a tab causes the tab bar controller to display the associated view controller’s view on the screen. View Controller Basics A Taxonomy of View Controllers 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 23Figure 1-8 shows several modes of the Clock app along with the relationships between the corresponding view controllers. Each mode has a content view controller to manage the main content area. In the case of the Clock app, the Clock and Alarm view controllers both display a navigation-style interface to accommodate some additional controls along the top of the screen. The other modes use content view controllers to present a single screen. Figure 1-8 Different modes of the Clock app You use tab bar controllers when your app either presents different types of data or presents the same data in different ways. For information about how to configure and use a tab bar controller, see “Tab Bar Controllers”. About Split View Controllers A split view controller divides the screen into multiple parts, each of which can be updated separately. The appearance of a split view controller may vary depending on its orientation. A split view controller is an instance of the UISplitViewController class. The contents of a split view interface are derived from two child view controllers. View Controller Basics A Taxonomy of View Controllers 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 24Figure 1-9 shows a split view interface from the MultipleDetailViews sample app. In portait mode, only the detail view is displayed. The list view is made available using a popover. However, when displayed in landscape mode, the split view controller displays the contents of both children side by side. Figure 1-9 A master-detail interface in portrait and landscape modes Split view controllers are supported on iPad only and are designed to help you take advantage of the larger screen of that device. They are the preferred way to implement master-detail interfaces in iPad apps. For information about how to configure and use a split view controller, see “Popovers”. About Popover Controllers Look again at Figure 1-9. When the split view controller is displayed in portrait mode, the master views is displayed in a special control, known as a popover. In an iPad app, you can use popover controllers (UIPopoverController) to implement popovers in your own app. A popover controller is not actually a container; it does not inherent from UIViewController at all. But, in practice, a popover controller is similar to a container, so you apply the same programming principles when you use them. For information about how to configure and use a popover controller, see “Popovers”. View Controller Basics A Taxonomy of View Controllers 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 25About Page View Controllers A page view controller is a container view controller used to implement a page layout. That layout allows users to flip between discrete pages of content as if it were a book. A page view controller is an instance of the UIPageViewController class. Each content page is provided by a content view controller. The page view controller managesthe transitions between pages. When new pages are required, the page view controller calls an associated data source to retrieve a view controller for the next page. For information about how to configure and use a page view controller, see “Page View Controllers”. A View Controller’s Content Can Be Displayed in Many Ways For a view controller’s contents to be visible to the user, it must be associated with a window. There are many ways you can do this in your app: ● Make the view controller a window’s root view controller. ● Make the view controller a child of a container. ● Show the view controller in a popover control. ● Present it from another view controller. View Controller Basics A View Controller’s Content Can Be Displayed in Many Ways 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 26Figure 1-10 shows an example from the Contacts app. When the user clicks the plus button to add a new contact, the Contacts view controller presentsthe New Contact view controller. The New Contactscreen remains visible until the user cancels the operation or provides enough information about the contact that it can be saved to the contacts database. At that point the information is transmitted to the Contacts view controller, which then dismisses the controller it presented. Figure 1-10 Presenting a view controller A presented view controller isn’t a specific type of view controller—the presented view controller can be either a content or a container view controller with an attached content view controller. In practice, the content view controller is designed specifically to be presented by another controller, so it can be useful to think of it as a variant of a content view controller. Although container view controllers define specific relationships between the managed view controllers, using presentation allows you to define the relationship between the view controller being presented and the view controller presenting it. View Controller Basics A View Controller’s Content Can Be Displayed in Many Ways 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 27Most of the time, you present view controllersto gather information from the user or capture the user’s attention for some specific purpose. Once that purpose is completed, the presenting view controller dismisses the presented view controller and returns to the standard app interface. It is worth noting that a presented view controller can itself present another view controller. This ability to chain view controllers together can be useful when you need to perform several modal actions sequentially. For example, if the user taps the Add Photo button in the New Contact screen in Figure 1-10 and wants to choose an existing image, the New Contact view controller presents an image picker interface. The user must dismiss the image picker screen and then dismiss the New Contact screen separately to return to the list of contacts. When presenting a view controller, one view controller determines how much of the screen is used to present the view controller. The portion of the screen is called the presentation context By default, the presentation context is defined to cover the window. For more information about how to present view controllers in your app, see “Presenting View Controllers from Other View Controllers” (page 88). View Controllers Work Together to Create an App’s Interface View controllers manage their views and other associated objects, but they also work with other view controllers to provide a seamless user interface. The distribution of work and communication between your app’s view controllers is an essential part of working with them. Because these relationships are so important to building complex apps, this next section reviews the relationships already discussed and describes them in more detail. View Controller Basics View Controllers Work Together to Create an App’s Interface 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 28Parent-Child Relationships Represent Containment A view controller hierarchy starts with a single parent, the root view controller of a window. If that view controller is a container, it may have children that provide content. Those controllers, in turn, may also be containers with children of their own. Figure 1-11 shows an example of a view controller hierarchy. The root view controller is a tab view controller with four tabs. The first tab uses a navigation controller with children of its own and the other three tabs are managed by content view controllers with no children. Figure 1-11 Parent-child relationships The area each view controller fills is determined by its parent. The root view controller’s area is determined by the window. In Figure 1-11, the tab view controller gets its size from the window. It reserves space for its tab bar and gives the remainder of the space to its children. If the navigation controller were the control displayed right now, it reserves space for its navigation bar and hands the rest to its content controller. At each step, the child view controller’s view is resized by the parent and placed into the parent’s view hierarchy. This combination of views and view controllers also establishes the responder chain for events handled by your app. Sibling Relationships Represent Peers Inside a Container The kind of container defines the relationships (if any exists) shared by its children. For example, compare the tab view controller and navigation controller. ● In a tab view controller, the tabs represent distinct screens of content; tab bar controllers do not define a relationship between its children, although your app can choose to do so. ● In a navigation controller, siblings display related views arranged in a stack. Siblings usually share a connection with adjacent siblings. View Controller Basics View Controllers Work Together to Create an App’s Interface 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 29Figure 1-12 shows a common configuration of view controllers associated with a navigation controller. The first child, the master, shows the available content without showing all of the details. When an item is selected, it pushes a new sibling onto the navigation controller so that the user can see the additional details. Similarly, if the user needsto see more details, thissibling can push another view controller thatshowsthe most detailed content available. When siblings have a well defined relationship as in this example, they often coordinate with each other, either directly or through the container controller. See Figure 1-15 (page 32). Figure 1-12 Sibling relationships in a navigation controller Presentation Represents a Transient Display of Another Interface A view controller presents another view controller when it wants that view controller to perform a task. The presenting view controller is in charge of this behavior. It configures the presented view controller, receives information from it, and eventually dismisses it. However, while it is being presented, the presented view controller’s view is temporarily added to the window’s view hierarchy. In Figure 1-13, a content view controller attached to the tab view presents a view controller to perform a task. The content controller is the presenting view controller, and the modal view controller is the presented view controller. Figure 1-13 Modal presentation by a content view View Controller Basics View Controllers Work Together to Create an App’s Interface 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 30When a view controller is presented, the portion of the screen that it coversis defined by a presentation context provided to it by another view controller. The view controller that provides the presentation context does not need be the same view controller that presented it. Figure 1-14 shows the same view controller hierarchy that is presented in Figure 1-13. You can see that the content view presented the view controller, but it did not provide the presentation context. Instead, the view controller was presented by the tab controller. Because of this, even though the presenting view controller only covers the portion of the screen provided to it by the tab view controller, the presented view controller uses the entire area owned by the tab view controller. Figure 1-14 The actual presentation is performed by the root view controller. Control Flow Represents Overall Coordination Between Content Controllers In an app with multiple view controllers, view controllers are usually created and destroyed throughout the lifetime of the app. During their lifetimes, the view controllers communicate with each other to present a seamless user experience. These relationships represent the control flow of your app. Most commonly, this control flow happens when a new view controller isinstantiated. Usually, a view controller is instantiated because of actions in another view controller. The first view controller, known as the source view controller directs the second view controller, the destination view controller. If the destination view controller presents data to the user, the source view controller usually provides that data. Similarly, if the source view controller needsinformation from the destination view controller, it isresponsible for establishing the connection between the two view controllers. Figure 1-15 shows the most common examples of these relationships. In the figure: ● A child of a navigation controller pushes another child onto the navigation stack. ● A view controller presents another view controller. View Controller Basics View Controllers Work Together to Create an App’s Interface 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 31● A view controller displays another view controller in a popover. Figure 1-15 Communication between source and destination view controllers Each controller is configured by the one preceding it. When multiple controllers work together, they establish a communication chain throughout the app. The control flow at each link in this chain is defined by the destination view controller. The source view controller uses the conventions provided by the destination view controller. ● The destination view controller provides properties used to configure its data and presentation. ● If the destination view controller needs to communicate with view controllers preceding it in the chain, it uses delegation. When the source view controller configures the destination view controller’s other properties, it is also expected to provide an object that implements the delegate’s protocol. The benefit of using this control flow convention is that there is a clean division of responsibilities between each pair ofsource and destination view controllers. Data flows down the path when the source view controller asksthe destination view controller to perform a task; the source view controller drivesthe process. For example, it might provide the specific data object that the destination controller should display. In the other direction, data flows up the path when a view controller needsto communicatesinformation back to the source controller that spawned it. For example, it might communicate when the task completes. Also, by consistently implementing this control flow model, you ensure that destination view controllers never know too much about the source view controller that configured them. When it does know about a view controller earlier in the chain, it knows only that the class implements the delegate protocol, not the class of the class. By keeping view controllersfrom knowing too much about each other, individual controllers become more reusable. For someone reading your code, a consistently implemented control flow model makes it easy to see the communication path between any pair of controllers. View Controller Basics View Controllers Work Together to Create an App’s Interface 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 32Storyboards Help You Design Your User Interface When you implement your app using storyboards, you use Interface Builder to organize your app’s view controllers and any associated views. Figure 1-16 shows an example interface layout from Interface Builder. The visual layout of Interface Builder allows you to understand the flow through your app at a glance. You can see what view controllers are instantiated by your app and their order of instantiation. But more than that, you can configure complex collections of views and other objects in the storyboard. The resulting storyboard is stored as a file in your project. When you build your project, the storyboards in your project are processed and copied into the app bundle, where they are loaded by your app at runtime. Figure 1-16 A storyboard diagram in Interface Builder Often, iOS can automatically instantiate the view controllersin yourstoryboard at the moment they are needed. Similarly, the view hierarchy associated with each controller is automatically loaded when it needs to be displayed. Both view controllers and views are instantiated with the same attributes you configured in Interface Builder. Because most of this behavior is automated for you, it greatly simplifies the work required to use view controllers in your app. The full details of creating storyboards are described in Xcode 4 User Guide . For now, you need to know some of the essential terminology used when implementing storyboards in your app. A scene represents an onscreen content area that is managed by a view controller. You can think of a scene as a view controller and its associated view hierarchy. View Controller Basics Storyboards Help You Design Your User Interface 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 33You create relationships between scenes in the same storyboard. Relationships are expressed visually in a storyboard as a connection arrow from one scene to another. Interface Builder usually infers the details of a new relationship automatically when you make a connection between two objects. Two important kinds of relationships exist: ● Containment represents a parent-child relationship between two scenes. View controllers contained in other view controllers are instantiated when their parent controller is instantiated. For example, the first connection from a navigation controller to another scene defines the first view controller pushed onto the navigation stack. This controller is automatically instantiated when the navigation controller is instantiated. An advantage to using containment relationships in a storyboard is that Interface Builder can adjust the appearance of the child view controller to reflect the presence of its ancestors. This allowsInterface Builder to display the content view controller as it appears in your final app. ● A segue represents a visual transition from one scene to another. At runtime, segues can be triggered by various actions. When a segue istriggered, it causes a new view controller to be instantiated and transitioned onscreen. Although a segue is always from one view controller to another, sometimes a third object can be involved in the process. This object actually triggersthe segue. For example, if you make a connection from a button in the source view controller’s view hierarchy to the destination view controller, when the user taps the button, the segue is triggered. When a segue is made directly from the source view controller to the destination view controller, it usually represents a segue you intend to trigger programatically. Different kinds of segues provide the common transitions needed between two different view controllers: ● A push segue pushes the destination view controller onto a navigation controller’s stack. ● A modal segue presents the destination view controller. ● A popover segue displays the destination view controller in a popover. ● A custom segue allows you to design your own transition to display the destination view controller. Segues share a common programming model. In this model, the destination controller is instantiated automatically by iOS and then the source view controller is called to configure it. This behavior matches the control flow model described in “Control Flow Represents Overall Coordination Between Content Controllers” (page 31). You can also create connections between a view controller and objects stored in the same scene. These outlets and actions enable you to carefully define the relationships between the view controller and its associated objects. Connections are not normally visible in the storyboard itself but can be viewed in the Connections Inspector of Interface Builder. View Controller Basics Storyboards Help You Design Your User Interface 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 34Whether you are working with view controllers provided by iOS, or with custom controllers you’ve created to show your app’s content, you use a similar set of techniques to actually work with the view controllers. The most common technique for working with view controllers is to place them inside a storyboard. Placing view controllers in a storyboard allows you to directly establish relationships between the view controllers in your app without writing code. You can see the flow of control—from controllers created when your app first launches, to controllers that are instantiated in response to a user’s actions. iOS manages most of this process by instantiating these view controllers only when the app needs them. Sometimes you may need to create a view controller by allocating and initializing it programmatically. When working with view controllers directly, you must write code that instantiates the view controller, configures it, and displays it. 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 35 Using View Controllers in Your AppWorking with View Controllers in Storyboards Figure 2-1 shows an example of a storyboard. This storyboard includes view controllers, associated views, and connection arrows that establish relationships between the view controllers. In effect, this storyboard tells a story, starting with one scene and later showing others in response to a user’s actions. Figure 2-1 A storyboard holds a set of view controllers and associated objects A storyboard may designate one view controller to be the initial view controller. If a storyboard represents a specific workflow through part of your UI, the initial view controller represents the first scene in that workflow. You establish relationships from the initial view controller to other view controllers in the storyboard. In turn, you establish relationships from those view controllers to others, eventually connecting most or all of the storyboard’s scenes into a single connected graph. The type of relationship you establish determines when a connected view controller is instantiated by iOS, as follows: ● If the relationship is a segue, the destination view controller is instantiated when the segue is triggered. ● If the relationship represents containment, the child view controller is instantiated when its parent is instantiated. ● If the controller is not the destination or child of another controller, it is never instantiated automatically. You must instantiate it from the storyboard programmatically. Using View Controllers in Your App Working with View Controllers in Storyboards 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 36To identify a specific view controller or segue inside a storyboard, use Interface Builder to assign it an identifier string that uniquely identifies it. To programmatically load a view controller from the storyboard, you must assign it an identifier. Similarly, to trigger a segue programmatically, it must also be assigned an identifier. When a segue is triggered, that segue's identifier is passed to the source view controller, which uses it to determine which segue was triggered. For this reason, consider labeling every segue with an identifier. When you build an app using storyboards, you can use a single storyboard to hold all of its view controllers, or you can create multiple storyboards and implement a portion of the user interface in each. One storyboard in your app is almost always designated as the main storyboard. If there is a main storyboard, iOS loads it automatically; other storyboards must be explicitly loaded by your app. The Main Storyboard Initializes Your App’s User Interface The main storyboard is defined in the app’s Information property list file. If a main storyboard is declared in this file, then when your app launches, iOS performs the following steps: 1. It instantiates a window for you. 2. It loads the main storyboard and instantiates its initial view controller. 3. It assigns the new view controller to the window’s rootViewController property and then makes the window visible on the screen. Your app delegate is called to configure the initial view controller before it is displayed. The precise set of steps iOS uses to load the main storyboard is described in “Coordinating Efforts Between View Controllers” (page 98). Segues Automatically Instantiate the Destination View Controller A segue represents a triggered transition that brings a new view controller into your app’s user interface. Segues contain a lot of information about the transition, including the following: ● The object that caused the segue to be triggered, known as the sender ● The source view controller that starts the segue ● The destination view controller to be instantiated ● The kind of transition that should be used to bring the destination view controller onscreen ● An optional identifier string that identifies that specific segue in the storyboard When a segue is triggered, iOS takes the following actions: 1. It instantiates the destination view controller using the attribute values you provided in the storyboard. Using View Controllers in Your App Working with View Controllers in Storyboards 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 372. It gives the source view controller an opportunity to configure the new controller. 3. It performs the transition configured in the segue. Note: When you implement custom view controllers, each destination view controller declares public properties and methods used by the source view controller to configure its behavior. In return, your custom source view controllers override storyboard methods provided by the base class to configure the destination view controller. The precise details are in “Coordinating Efforts Between View Controllers” (page 98). Triggering a Segue Programmatically A segue is usually triggered because an object associated with the source view controller, such as a control or gesture recognizer, triggered the segue. However, a segue can also be triggered programmatically by your app, as long as the segue has an assigned identifier. For example, if you are implementing a game, you might trigger a segue when a match ends. The destination view controller then displays the match’s final scores. You programmatically trigger the segue by calling the source view controller’s performSegueWithIdentifier:sender: method, passing in the identifier for the segue to be triggered. You also pass in another object that acts as the sender. When the source controller is called to configure the destination view controller, both the sender object and the identifier for the segue are provided to it. Listing 2-1 shows a simple method that triggers a segue. This example is a portion of a larger example described in “Creating an Alternate Landscape Interface” (page 80). In this abbreviated form, you can see that the view controller is receiving an orientation notification. When the view controller is in portrait mode and the device is rotated into landscape orientation, the method uses a segue to present a different view controller onscreen. Because the notification object in this case provides no useful information for performing the segue command, the view controller makes itself the sender. Listing 2-1 Triggering a segue programmatically - (void)orientationChanged:(NSNotification *)notification { UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation; if (UIDeviceOrientationIsLandscape(deviceOrientation) && !isShowingLandscapeView) { [self performSegueWithIdentifier:@"DisplayAlternateView" sender:self]; isShowingLandscapeView = YES; } Using View Controllers in Your App Working with View Controllers in Storyboards 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 38// Remainder of example omitted. } If a segue can be triggered only programmatically, you usually draw the connection arrow directly from the source view controller to the destination view controller. Instantiating a Storyboard’s View Controller Programmatically You may want to programmatically instantiate a view controller without using a segue. A storyboard is still valuable, because you can use it to configure the attributes of the view controller as well as its view hierarchy. However, if you do instantiate a view controller programmatically, you do not get any of the behavior of a segue. To display the view controller, you must implement additional code. For this reason, you should rely on segues where possible and use this technique only when needed. Here are the steps your code needs to implement: 1. Obtain a storyboard object (an object of the UIStoryboard class). If you have an existing view controller instantiated from the same storyboard, read its storyboard property to retrieve the storyboard. To load a different storyboard, call the UIStoryboard class’s storyboardWithName:bundle: class method, passing in the name of the storyboard file and an optional bundle parameter. 2. Call the storyboard object’s instantiateViewControllerWithIdentifier: method, passing in the identifier you defined for the view controller when you created it in Interface Builder. Alternatively, you can use the instantiateInitialViewController method to instantiate the initial view controller in a storyboard, without needing to know its identifier. 3. Configure the new view controller by setting its properties. 4. Display the new view controller. See “Displaying a View Controller’s Contents Programmatically” (page 41). Listing 2-2 shows an example of this technique. It retrieves the storyboard from an existing view controller and instantiates a new view controller using it. Listing 2-2 Instantiating another view controller inside the same storyboard - (IBAction)presentSpecialViewController:(id)sender { UIStoryboard *storyboard = self.storyboard; SpecialViewController *svc = [storyboard instantiateViewControllerWithIdentifier:@"SpecialViewController"]; Using View Controllers in Your App Working with View Controllers in Storyboards 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 39// Configure the new view controller here. [self presentViewController:svc animated:YES completion:nil]; } Listing 2-3 shows another frequently used technique. This example loads a new storyboard and instantiates its initial view controller. It uses this view controller as the root view controller for a new window being placed on an external screen. To display the returned window, your app calls the window’s makeKeyAndVisible method. Listing 2-3 Instantiating a view controller from a new storyboard - (UIWindow*) windowFromStoryboard: (NSString*) storyboardName onScreen: (UIScreen*) screen { UIWindow *window = [[UIWindow alloc] initWithFrame:[screen bounds]]; window.screen = screen; UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle:nil]; MainViewController *mainViewController = [storyboard instantiateInitialViewController]; window.rootViewController = mainViewController; // Configure the new view controller here. return window; } Transitioning to a New Storyboard Requires a Programmatic Approach Segues connect only scenes that are stored in the same storyboard. To display a view controller from another storyboard, you must explicitly load the storyboard file and instantiate a view controller inside it. There is no requirement that you create multiple storyboards in your app. Here, though, are a few cases where multiple storyboards might be useful to you: Using View Controllers in Your App Working with View Controllers in Storyboards 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 40● You have a large programming team, with different portions of the user interface assigned to different parts of the team. In this case, each subteam owns a storyboard limiting the number of team members working on any specific storyboard’s contents. ● You purchased or created a library that predefines a collection of view controller types; the contents of those view controllers are defined in a storyboard provided by the library. ● You have content that needs to be displayed on an external screen. In this case, you might keep all of the view controllers associated with the alternate screen inside a separate storyboard. An alternative pattern for the same scenario is to write a custom segue. Containers Automatically Instantiate Their Children When a container in a storyboard is instantiated, its children are automatically instantiated at the same time. The children must be instantiated at the same time to give the container controller some content to display. Similarly, if the child that was instantiated is also a container, its children are also instantiated, and so on, until no more containment relationships can be traced to new controllers. If you place a content controller inside a navigation controller inside a tab bar controller, when the tab bar is instantiated, the three controllers are simultaneously instantiated. The container and its descendants are instantiated before your view controller is called to configure them. Your source view controller (or app delegate) can rely on all the children being instantiated. This instantiation behavior is important, because your custom configuration code rarely configures the container(s). Instead, it configures the content controllers attached to the container. Instantiating a Non-Storyboard View Controller To create a view controller programmatically without the use of the storyboard, you use Objective-C code to allocate and initialize the view controller. You gain none of the benefits of storyboards, meaning you have to implement additional code to configure and display the new view controller. Displaying a View Controller’s Contents Programmatically For a view controller’s content to be useful, it needs to be displayed on screen. There are several options for displaying a view controller’s contents: ● Make the view controller the root view controller of a window. ● Make it a child of a visible container view controller. ● Present it from another visible view controller. Using View Controllers in Your App Instantiating a Non-Storyboard View Controller 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 41● Present it using a popover (iPad only). In all cases, you assign the view controller to another object—in this case, a window, a view controller, or a popover controller. This object resizes the view controller’s view and adds it to its own view hierarchy so that it can be displayed. Listing 2-4 showsthe most common case, which isto assign the view controller to a window. This code assumes that a storyboard is not being used, so it performs the same steps that are normally done on your behalf by the operating system: It creates a window and setsthe new controller asthe root view controller. Then it makes the window visible. Listing 2-4 Installing the view controller as a window’s root view controller - (void)applicationDidFinishLaunching:(UIApplication *)application { UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; levelViewController = [[LevelViewController alloc] init]; window.rootViewController = levelViewController; [window makeKeyAndVisible]; } Important: Never install the view controller’s view into a view hierarchy directly. To present and manage views properly, the system makes a note of each view (and its associated view controller) that you display. It uses this information later to report view controller–related events to your app. For example, when the device orientation changes, a window uses this information to identify the frontmost view controller and notify it of the change. If you incorporate a view controller’s view into your hierarchy by other means, the system may handle these events incorrectly. If you are implementing your own custom container controller, you add another view controller’s view to your own view hierarchy, but you also create a parent-child relationship first. This ensures that events are delivered correctly. See “Creating Custom Container View Controllers” (page 111). Using View Controllers in Your App Displaying a View Controller’s Contents Programmatically 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 42Custom content view controllers are the heart of your app. You use them to present your app’s unique content. All apps need at least one custom content view controller. Complex apps divide the workload between multiple content controllers. A view controller has many responsibilities. Some of these responsibilities are things that iOS requires the view controller to do. Other responsibilities are things you assign to the view controller when you define its role in your app. Anatomy of a Content View Controller The UIViewController class provides the fundamental infrastructure for implementing all custom view controllers. You define a custom subclass of UIViewController. That subclass provides the necessary code to populate views with data and respond to user actions. When you want to make adjustments to the default behavior of the view controller, you override methods of the UIViewController class. Your view controller may also interact with other UIKit classes to implement the behavior you want. 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 43 Creating Custom Content View ControllersFigure 3-1 shows some of the key objects associated directly with a content view controller. These are the objectsthat are essentially owned and managed by the view controller itself. The view (accessible via the view property) is the only object that must be provided, although most view controllers have additional subviews attached to this view as well as custom objects containing the data they need to display. Figure 3-1 Anatomy of a content view controller View View View View Content view controller Custom data objects When you design a new view controller, it potentially has many responsibilities. Some of those responsibilities look inward, to the views and other objects it controls. Other responsibilities look outward to other controllers. The following sections enumerate many of the common responsibilities for a view controller. View Controllers Manage Resources Some objects are instantiated when the view controller is initialized and are disposed of when your view controller is released. Other objects, like views, are needed only when the view controller’s contents are visible onscreen. As a result, view controllers use resources efficiently and should be prepared to release resources when memory is scarce. Properly implementing this behavior in your app's view controllers makes it so your app uses memory and other resources—such as CPU, GPU, and battery—more efficiently. See “Resource Management in View Controllers” (page 56). Creating Custom Content View Controllers Anatomy of a Content View Controller 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 44View Controllers Manage Views View controllers manage their view and its subviews, but the view’s frame—its position and size in its parent’s view—is often determined by other factors, including the orientation of the device, whether or not the status bar is visible and even how the view controller’s view is displayed in the window. Your view controller should be designed to layout its view to fit the frame provided to it. View management has other aspects as well. Your view controller is notified when its view is about to appear and disappear from the screen. Your view controller can use this notification to perform other actions necessary to its operation. See “Resizing the View Controller’s Views” (page 69), “Supporting Multiple Interface Orientations” (page 74), “Responding to Display-Related Notifications” (page 66). View Controllers Respond to Events Your view controller is often the central coordinating object for its views and controls. Typically, you design your user interface so that controls send messages to the controller when a user manipulates them. Your view controller is expected to handle the message, making any necessary changes to the views or data stored in the view controller. Your view controller also participates in the responder chain used to deliver events to your app. You can override methodsin your view controller classto have it participate directly in event handling. View controllers also are good objects to implement other behaviors—such as responding to system notifications, timers or events specific to your app. See “Using View Controllers in the Responder Chain” (page 72). View Controllers Coordinate with Other Controllers Although a view controller may create and manage many other objects, it does not usually need to expose these objects publicly to inspection or modification. It may collaborate with other objects (especially other view controllers), but it should expose the fewest number of properties and methods necessary to allow its collaborators to communicate with it. Exposing too many implementation details in your view controller class makes it difficult to modify your view controller’s implementation. Collaborators that rely on these implementation details would need to be modified to continue to work with your view controller class. See “Coordinating Efforts Between View Controllers” (page 98). Creating Custom Content View Controllers Anatomy of a Content View Controller 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 45View Controllers Often Work with Containers If your view controller is placed inside a container view controller, the container imposes additional constraints, as shown in Figure 3-2. The container may ask your view controller to provide other objects used to configure the container’s user interface. For example, a content view controller placed inside a tab view controller provides a tab bar item to display for that tab. Figure 3-2 A container view controller imposes additional demands on its children The properties used to configure the containers provided by UIKit are defined by the UIViewController class. For more information on specific types of containers and the properties you configure to support them, see View Controller Catalog for iOS . View Controllers May Be Presented by Other View Controllers Some view controllers you design are intended to be presented by other view controllers. You might present your view controller directly, or you might make it a child of a container view controller and present the container instead. When presented, it moves onscreen, remaining there until it is dismissed. There are several reasons you might present a view controller: Creating Custom Content View Controllers Anatomy of a Content View Controller 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 46● To gather information from the user immediately. ● To present some content temporarily. ● To change work modes temporarily. ● To implement alternate interfaces for different device orientations. ● To present a new view hierarchy with a specific type of animated transition (or no transition). Most of these reasons involve interrupting your app’s workflow temporarily in order to gather or display some information. In almost all cases, the presented view controller implements a delegate. The presented view controller uses the delegate to communicate with the presenting view controller. After your app has the information it needs (or the user finishes viewing the presented information), the presented view controller communicates this back to the presenting view controller. The presenting view controller dismisses the presented view controller to return the app to its previous state. See “Presenting View Controllers from Other View Controllers” (page 88). Designing Your Content View Controller Before writing any code in your view controller, you should be able to answer some basic questions about how you intend to use it. The questions provided below are designed to help you narrow the focus of your view controller and to help you understand the role it plays in your app. In particular, it helps you identify connections—usually to other controllers—your view controller needs to perform its tasks. ● Are you using a storyboard to implement the view controller? ● When is it instantiated? ● What data does it show? ● What tasks does it perform? ● How is its view displayed onscreen? ● How does it collaborate with other view controllers? Your answers to these questions need not be precise if you are still working out the role it plays. Still, it helps to have a general sense of what your view controller does and how other objects interact with it. The questions above don’t ask you to define the appearance of your view controller or to be precise about the implementation details of how it performs the tasks you’ve assigned to it. Those are important questions you need to answer, but neither of these things should affect your view controller’s public interface. You want the flexibility to be able to change the visual design of your view controller without changing the class declaration that defines how other controllers collaborate with it. Creating Custom Content View Controllers Designing Your Content View Controller 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 47Use a Storyboard to Implement Your View Controller You might consider whether or not to use a storyboard as an implementation detail, but the approach you take affects how you implement the view controller and how other objects collaborate with it. You always use a storyboard unless you have a strong reason not to. When you use storyboards: ● iOS usually instantiates your view controller for you automatically. ● To finish instantiating it, you override its awakeFromNib method. ● Other objects configure it through its properties. ● You create its view hierarchy and other related objects in Interface Builder. These objects are loaded automatically when the view is needed. ● Relationships with other view controllers are created in the storyboard. If you design your view controller to be used programmatically: ● The view controller is instantiated by allocating and initializing it. ● You create an custom initialization method to initialize the view controller. ● Other objects configure the view controller using itsinitialization method and by configuring its properties. ● You override the loadView method to programmatically create and configure its view hierarchy. ● Relationships with other view controllers are created by writing code. Know When Your Controller Is Instantiated Knowing when your view controller is instantiated usually implies other details for how your app operates. For example, you might know that your view controller is alwaysinstantiated by the same object. Often the objects that instantiate view controllers are themselves view controllers; this is almost always the case in an app that uses storyboards. In any case, knowing when, why, and by what object your view controller is instantiated gives you insight into the information exchanged between your view controller and the object that created it. Know What Data Your View Controller Shows and Returns When you answer these two questions, you are working to understand the data model for your app and also whether that data needs to be exchanged between your view controllers. Here are some common patterns you should expect to see in your view controllers: Creating Custom Content View Controllers Designing Your Content View Controller 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 48● The view controller receives data from another controller and displays it, without offering a way to edit it. No data is returned. ● The view controller allows the user to enter new data. After the user finishes editing the data, it sends the new data to another controller. ● The view controller receives data from another controller and allows the user to edit it. After the user finishes editing the data, it sends the new data to another controller. ● The view controller doesn’t send or receive data. Instead, it shows static views. ● The view controller doesn’tsend or receive data. Instead, itsimplementation loadsits data without exposing this mechanism to other view controllers. For example, the GKAchievementViewController class has built-in functionality to determine which player is authenticated on the device. It also knows how to load that player’s data from Game Center. The presenting view controller does not need to know what data is loaded or how it was loaded. You are not constrained to use only these designs. When data travels into or out of your view controller, consider defining a data model class to hold the data to be transferred to the new controller. For example, in Your Second iOS App: Storyboards, the master controller uses a BirdSighting object to send data associated with a sighting to the detail controller. Using an object for this makes it easier to update the data to include additional properties without changing the method signatures in your controller classes. Know What Tasks Your Controller Allows the User to Perform Some view controllers allow users to view, create, or edit data. Other view controllers allow users to navigate to otherscreens of content. And some allow usersto perform tasks provided by the view controller. For example, the MFMailComposeViewController class allows a user to compose and send emails to other users. It handles the low-level details of sending mail messages. As you determine which tasks your view controller performs, decide how much control over those tasks your view controller exposes to other controllers. Many view controllers can perform tasks without exposing configuration data to other controllers. For example, the GKAchievementViewController class displays achievements to the user without exposing any properties to configure how it loads or presents its data. The MFMailComposeViewController class presents a slightly different scenario by exposing some properties that another controller can use to configure the initial content it displays. After that, a user can edit the content and send the email message without giving other controller objects a chance to affect that process. Creating Custom Content View Controllers Designing Your Content View Controller 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 49Know How Your View Controller Is Displayed Onscreen Some view controllers are designed to be root view controllers. Others expect to be presented by another view controller or placed in a container controller. Occasionally, you design controllers that can be displayed in multiple ways. For example, a split view controller’s master view is displayed in the split view in landscape mode and in a popover control in portrait mode. Knowing how your view controller is displayed gives you insight into how its view issized and placed onscreen. It also affects other areas, such as determining what other controllers your view controller collaborates with. Know How Your Controller Collaborates with Other Controllers By this point, you already know some things about collaboration. For example, if your view controller is instantiated from a segue, then it probably collaborates with the source view controller that configures it. And if your controller is a child of a container, then it collaborates with the container. But there are relationships in the other direction as well. For example, your view controller might defer some of its work and hand it off to another view controller. It might even exchange data with an existing view controller. With all of these connections, your view controller provides an interface that other controllers use, or it is aware of other controllers and it uses their interfaces. These connections are essential to providing a seamless experience, but they also represent design challenges because they introduce dependencies between classes in your app. Dependencies are a problem because they make it more difficult to change any one class in isolation from the other classes that make up your app. For this reason, you need to balance the needs of your app now against the potential need to keep your app design flexible enough to change later. Examples of Common View Controller Designs Designing a new view controller can be challenging. It helps to look at existing designs and understand what they do and why. This next section talks about some common view controller styles used in iOS apps. Each example includes a description of the role the view controller plays, a brief description of how it works at a high level, and one possible list of answers to the design questions listed above. Example: Game Title Screen Mission Statement A view controller that allows the user to select between different styles of game play. Creating Custom Content View Controllers Examples of Common View Controller Designs 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 50Description When a game is launched, it rarely jumps right into the actual game. Instead, it displays a title screen that identifies the game and presents a set of game variants to the player. For example, a game might offer buttons that allow a player to start a single player or multiplayer game. When the user selects one of the options, the app configures itself appropriately and launches into its gameplay. A title screen is interesting specifically because its contents are static; they don’t need data from another controller. As such, this view controller is almost entirely self-sufficient. It does, however, know about other view controllers, because it instantiates other view controllers to launch its gameplay. Design ● Are you using a storyboard to implement the view controller? Yes. ● When is it instantiated? This view controller is the initial scene in the main storyboard. ● What data does it show? This class displays preconfigured controls and images; it does not present user data. It does not include configurable properties. ● What tasks does it perform? When a user taps on a button, it triggers a segue to instantiate another view controller. Each segue is identified so that the appropriate game play can be configured. ● How is its view displayed onscreen? It isinstalled automatically asthe root view controller of the window. ● How does it collaborate with other view controllers? It instantiates another view controller to present a gameplay screen. When gameplay ends, the other view controller sends a message to the title screen controller to inform it that play has ended. The title screen controller then dismisses the other view controller. Alternative Design Considerations The default answers assume that no user data is displayed. Some games include player data to configure the views or controls. For example: ● You might want the view controller to display the user’s Game Center alias. ● You might want it to enable or disable buttons based on whether the device is connected to Game Center. ● You might want it to enable or disable buttons based on In-App Purchase items the user has purchased. When these additional items are added to the design, the view controller takes on a more traditional role. It might receive data objects or data controllers from the app delegate so that it can query and update this state as necessary. Or, as it is the root view controller for the window, you might simply implement those behaviors directly in the title screen controller. The actual design likely depends on how flexible you need your code to be. Creating Custom Content View Controllers Examples of Common View Controller Designs 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 51Example: Master View Controller Mission Statement The initial view controller of a navigation controller, used to display a list of the app’s available data objects. Description A master view controller is a very common part of a navigation-based app. For example, Your Second iOS App: Storyboards uses a master view to display the list of bird sightings. When a user selects a sighting from the list, the master view controller pushes a new detail controller onto the screen. Because this view controller displays a list of items, it subclasses UITableViewController instead of UIViewController. Design ● Are you using a storyboard to implement the view controller? Yes. ● When is it instantiated? Asthe root view controller of a navigation controller, it isinstantiated at the same time as its parent. ● What data does it show? A high-level view of the app’s data. It implements properties that the app delegate uses to provide data to it. For example, the bird watching app provides a custom data controller object to the master view controller. ● What tasks does it perform? It implements an Add button to allow users to create new records. ● How is its view displayed onscreen? It is a child of a navigation controller. ● How does it collaborate with other view controllers? When the user taps on an item in the list, it uses a push segue to show a detail controller. When the user taps on the Add button, it uses a modal segue to present a new view controller that edits a new record. It receives data back from this modal view controller and sends this data to the data controller to create a new bird sighting. Alternative Design Considerations A navigation controller and an initial view controller is used when building an iPhone app. When designing the same app for the iPad, the master view controller is a child of a split view controller instead. Most other design decisions stay the same. Creating Custom Content View Controllers Examples of Common View Controller Designs 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 52Example: Detail View Controller Mission Statement A controller pushed onto a navigation stack to display the details for a list item selected from the master view controller. Description The detail view controller represents a more detailed view of a list item displayed by the master view controller. As with the master view controller, the list appears inside a nav bar interface. When the user finishes viewing the item they click a button in the nav bar to return to the master view. Your Second iOS App: Storyboards uses the UITableViewController class to implement its detail view. It uses a static table cells, each of which accesses one piece of the bird sighting data. A static table view is a good way to implement this design. Design ● Are you using a storyboard to implement the view controller? Yes. ● When is it instantiated? It is instantiated by a push segue from the master view controller. ● What data does it show? Itshowsthe data stored in a custom data object. It declares properties configured by the source view controller to provide this data. ● What tasks does it perform? It allows the user to dismiss the view. ● How is its view displayed onscreen? It is a child of a navigation controller. ● How does it collaborate with other view controllers? It receives data from the master view controller. Alternative Design Considerations A navigation controller is most often used when building an iPhone app. When designing the same app for the iPad, the detail view controller is a child of a split view controller instead. Many of the other implementation details stay the same. If your app needs more custom view behavior, it mightsubclassthe UIViewController class and implement its own custom view hierarchy. Creating Custom Content View Controllers Examples of Common View Controller Designs 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 53Example: Mail Compose View Controller Mission Statement A view controller that allows the user to compose and send an email. Description The Message UI framework provides the MFMailComposeViewController class. This class allows a user to compose and send an email. This view controller is interesting because it does more than simply show or edit data—it actually sends the email. Another interesting design choice in this class is that it allows an app to provide an initial configuration for the email message. After the initial configuration has been presented, the user can override these choices before sending the mail. Design ● Are you using a storyboard to implement the view controller? No. ● When is it instantiated? It is instantiated programmatically. ● What data does it show? It shows the various parts of an email message, including a recipients list, title, attachments and the email message itself. The class provides propertiesthat allow another view controller to preconfigure the email message. ● What tasks does it perform? It sends email. ● How is its view displayed onscreen? The view controller is presented by another view controller. ● How does it collaborate with other view controllers? It returns status information to its delegate. This status allows the presenting view controller to know whether an email was sent. Implementation Checklist for Custom Content View Controllers For any custom content view controllers you create, there are a few tasks that you must have your view controller handle: ● You must configure the view to be loaded by your view controller. Your custom class may need to override specific methods to manage how its view hierarchy is loaded and unloaded. These same methods might manage other resources that are created at the same time. See “Resource Management in View Controllers” (page 56). Creating Custom Content View Controllers Implementation Checklist for Custom Content View Controllers 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 54● You must decide which device orientations your view controller supports and how it reacts to a change in device orientation; see “Supporting Multiple Interface Orientations” (page 74). As you implement your view controller, you will likely discover that you need to define action methods or outlets to use with its views. For example, if the view hierarchy contains a table, you probably want to store a pointer to that table in an outletso that you can accessit later. Similarly, if your view hierarchy contains buttons or other controls, you probably want those controls to call an associated action method on the view controller. As you iterate through the definition of your view controller class, you may therefore find that you need to add the following items to your view controller class: ● Declared properties pointing to the objects containing the data to be displayed by the corresponding views ● Public methods and propertiesthat expose your view controller’s custom behavior to other view controllers ● Outlets pointing to views in the view hierarchy with which your view controller must interact ● Action methods that perform tasks associated with buttons and other controls in the view hierarchy Important: Clients of your view controller class do not need to know what views your view controller displays or what actions those views might trigger. Whenever possible, outlets and actions should be declared in a category inside your class’s implementation file. For example, if your class is named MyViewController, you implement the category by adding the following declaration to MyViewController.m: @interface MyViewController() // Outlets and actions here. @end @implementation MyViewController // Implementation of the privately declared category must go here. @end When you declare a category without a name, the properties and actions must be implemented in the same implementation block as any methods or properties declared in your public interface. The outlets and actions defined in the private category are visible to Interface Builder, but not to other classes in your app. This strategy allows you to gain the benefits of Interface Builder without exposing your class’s secrets. If another class needs access to your view controller’s functionality, add public methods and properties to access this functionality instead. Creating Custom Content View Controllers Implementation Checklist for Custom Content View Controllers 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 55View controllers are an essential part of managing your app’s resources. View controllers allow you to break your app up into multiple parts and instantiate only the parts that are needed. But more than that, a view controller itself manages different resources and instantiates them at different times. For example, a view controller’s view hierarchy is instantiated only when the view is accessed; typically, this occurs only when the view is displayed on screen. If multiple view controllers are pushed onto a navigation stack at the same time, only the topmost view controller’s contents are visible, which means only its views are accessed. Similarly, if a view controller is not presented by a navigation controller, it does not need to instantiate its navigation item. By deferring most resource allocation until it is needed, view controllers use less resources. When memory available to the app runs low, all view controllers are automatically notified by the system. This allows the view controller to purge caches and other objects that can be easily recreated later when memory is more plentiful. The exact behavior varies depending on which version of iOS your app is running on, and this has implications for your view controller design. Carefully managing the resources associated with your view controllers is critical to making your app run efficiently. You should also prefer lazy allocation; objects that are expensive to create or maintain should be allocated later and only when needed. For this reason, your view controllers should separate objects needed throughout the lifetime of the view controller from objects that are only necessary some of the time. When your view controller receives a low-memory warning, it should be prepared to reduce its memory usage if it is not visible onscreen. Initializing a View Controller When a view controller is first instantiated, it creates or loads objects it needs through its lifetime. It should not create its view hierarchy or objects associated with displaying content. It should focus on data objects and objects needed to implement its critical behaviors. Initializing a View Controller Loaded from a Storyboard When you create a view controller in a storyboard, the attributes you configure in Interface Builder are serialized into an archive. Later, when the view controller isinstantiated, this archive isloaded into memory and processed. The result is a set of objects whose attributes match those you set in Interface Builder. The archive is loaded 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 56 Resource Management in View Controllersby calling the view controller’s initWithCoder: method. Then, the awakeFromNib method is called on any object that implements that method. You use this method to perform any configuration steps that require other objects to already be instantiated. For more on archiving and archiving, see Archives and Serializations Programming Guide . Initializing View Controllers Programmatically If a view controller allocatesitsresources programmatically, create a custom initialization method that isspecific to your view controller. This method should call the super class’s init method and then perform any class specific initialization. In general, do not write complex initialization methods. Instead, implement a simple initialization method and then provide properties for clients of your view controller to configure its behaviors. A View Controller Instantiates Its View Hierarchy When Its View is Accessed Whenever some part of your app asks the view controller for its view object and that object is not currently in memory, the view controller loads the view hierarchy into memory and stores it in its view property for future reference. The steps that occur during the load cycle are: 1. The view controller calls its loadView method. The default implementation of the loadView method does one of two things: ● If the view controller is associated with a storyboard, it loads the views from the storyboard. ● If the view controller is not associated with a storyboard, an empty UIView object is created and assigned to the view property. 2. The view controller callsits viewDidLoad method, which enables yoursubclassto perform any additional load-time tasks. Resource Management in View Controllers A View Controller Instantiates Its View Hierarchy When Its View is Accessed 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 57Figure 4-1 shows a visual representation of the load cycle, including several of the methods that are called. Your app can override both the loadView and the viewDidLoad methods as needed to facilitate the behavior you want for your view controller. For example, if your app does not use storyboards but you want additional views to be added to the view hierarchy, you override the loadView method to instantiate these views programatically. Figure 4-1 Loading a view into memory Resource Management in View Controllers A View Controller Instantiates Its View Hierarchy When Its View is Accessed 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 58Loading a View Controller’s View from a Storyboard Most view controllersload their view from an associated storyboard. The advantage of using storyboardsisthat they allow you to lay out and configure your views graphically, making it easier and faster to adjust your layout. You can iterate quickly through different versions of your user interface to end up with a polished and refined design. Creating the View in Interface Builder Interface Builder is part of Xcode and provides an intuitive way to create and configure the views for your view controllers. Using Interface Builder, you assemble views and controls by manipulating them directly, dragging them into the workspace, positioning them, sizing them, and modifying their attributes using an inspector window. The results are then saved in a storyboard file, which stores the collection of objects you assembled along with information about all the customizations you made. Configuring the View Display Attributes in Interface Builder To help you layout the contents of your view properly, Interface Builder provides controls that let you specify whether the view has a navigation bar, a toolbar, or other objectsthat might affect the position of your custom content. If the controller is connected to container controllersin the storyboard, it can infer these settingsfrom the container, making it easier to see exactly how it should appear at runtime. Configuring Actions and Outlets for Your View Controller Using Interface Builder, you create connections between the views in your interface and your view controller. Listing 4-1 shows the declaration of a custom MyViewController class’s two custom outlets (designated by the IBOutlet keyword) and a single action method (designated by the IBAction return type). The declarations are made in a category inside the implementation file. The outlets store references to a button and a text field in the storyboard, while the action method responds to taps in the button. Listing 4-1 Custom view controller class declaration @interface MyViewController() @property (nonatomic) IBOutlet id myButton; @property (nonatomic) IBOutlet id myTextField; - (IBAction)myAction:(id)sender; @end Resource Management in View Controllers A View Controller Instantiates Its View Hierarchy When Its View is Accessed 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 59Figure 4-2 shows the connections you would create among the objects in such a MyViewController class. Figure 4-2 Connections in the storyboard When the previously configured MyViewController class is created and presented, the view controller infrastructure automatically loads the views from the storyboard and reconfigures any outlets or actions. Thus, by the time the view is presented to the user, the outlets and actions of your view controller are set and ready to be used. This ability to bridge between your runtime code and your design-time resource files is one of the things that makes storyboards so powerful. Creating a View Programmatically If you prefer to create views programmatically, instead of using a storyboard, you do so by overriding your view controller’s loadView method. Your implementation of this method should do the following: 1. Create a root view object. The root view contains all other views associated with your view controller. You typically define the frame for this view to match the size of the app window, which itself should fill the screen. However, the frame is adjusted based on how your view controller is displayed. See “Resizing the View Controller’s Views” (page 69). You can use a generic UIView object, a custom view you define, or any other view that can scale to fill the screen. 2. Create additional subviews and add them to the root view. Resource Management in View Controllers A View Controller Instantiates Its View Hierarchy When Its View is Accessed 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 60For each view, you should: a. Create and initialize the view. b. Add the view to a parent view using the addSubview: method. 3. If you are using auto layout, assign sufficient constraints to each of the views you just created to control the position and size of your views. Otherwise, implement the viewWillLayoutSubviews and viewDidLayoutSubviews methods to adjust the frames of the subviews in the view hierarchy. See “Resizing the View Controller’s Views” (page 69). 4. Assign the root view to the view property of your view controller. Listing 4-2 shows an example implementation of the loadView method. This method creates a pair of custom views in a view hierarchy and assigns them to the view controller. Listing 4-2 Creating views programmatically - (void)loadView { CGRect applicationFrame = [[UIScreen mainScreen] applicationFrame]; UIView *contentView = [[UIView alloc] initWithFrame:applicationFrame]; contentView.backgroundColor = [UIColor blackColor]; self.view = contentView; levelView = [[LevelView alloc] initWithFrame:applicationFrame viewController:self]; [self.view addSubview:levelView]; } Note: When overriding the loadView method to create your views programmatically, you should not call super. Doing so initiates the default view-loading behavior and usually just wastes CPU cycles. Your own implementation of the loadView method should do all the work that is needed to create a root view and subviewsfor your view controller. For more information on the view loading process, see “A View Controller Instantiates Its View Hierarchy When Its View is Accessed” (page 57). Managing Memory Efficiently When it comes to view controllers and memory management, there are two issues to consider: ● How to allocate memory efficiently Resource Management in View Controllers Managing Memory Efficiently 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 61● When and how to release memory Although some aspects of memory allocation are strictly yours to decide, the UIViewController class provides some methods that usually have some connection to memory management tasks. Table 4-1 lists the places in your view controller object where you are likely to allocate or deallocate memory, along with information about what you should be doing in each place. Table 4-1 Places to allocate and deallocate memory Task Methods Discussion Your custom initialization method (whether it is named init or something else) is always responsible for putting your view controller object in a known good state. This includes allocating whatever data structures are needed to ensure proper operation. Allocating critical Initialization methods data structures required by your view controller Overriding the loadView method is required only if you intend to create your views programmatically. If you are using storyboards, the views are loaded automatically from the storyboard file. Creating your view loadView objects Although you are free to use other designs, consider using a pattern similar the loadView method. Create a property that holds the method and a matched method to initialize the object. When the property is read and its value is nil, call the associated load method. Custom properties and methods Creating custom objects Data objects are typically provided by configuring your view controller’s properties. Any additional data objects your view controller wants to create should be done by overriding the viewDidLoad method. By the time this method is called, your view objects are guaranteed to exist and to be in a known good state. Allocating or viewDidLoad loading data to be displayed in your view Use this method to deallocate all noncritical objects associated with your view controller. On iOS 6, you can also use this method to release references to view objects. didReceiveMemoryWarning Responding to low-memory notifications Resource Management in View Controllers Managing Memory Efficiently 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 62Task Methods Discussion Override this method only to perform any last-minute cleanup of your view controller class. Objects stored in instance variables and properties are automatically released; you do not need to release them explicitly. Releasing critical dealloc data structures required by your view controller On iOS 6 and Later, a View Controller Unloads Its Own Views When Desired The default behavior for a view controller is to load its view hierarchy when the view property is first accessed and thereafter keep it in memory until the view controller is disposed of. The memory used by a view to draw itself onscreen is potentially quite large. However, the system automatically releasesthese expensive resources when the view is not attached to a window. The remaining memory used by most views is small enough that it is not worth it for the system to automatically purge and recreate the view hierarchy. You can explicitly release the view hierarchy if that additional memory is necessary for your app. Listing 4-3 overrides the didReceiveMemoryWarning method to accomplish this. First, is calls the superclass’s implementation to get any required default behavior. Then, it cleans up the view controller’s resources. Finally, it teststo see if the view controller’s view is not onscreen. If the view is associated with a window, then it cleans up any of the view controller’s strong references to the view and its subviews. If the views stored data that needs to be recreated, the implementation of this method should save that data before releasing any of the references to those views. Listing 4-3 Releasing the views of a view controller not visible on screen - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Add code to clean up any of your own resources that are no longer necessary. if ([self.view window] == nil) { // Add code to preserve data stored in the views that might be // needed later. // Add code to clean up other strong references to the view in // the view hierarchy. self.view = nil; } Resource Management in View Controllers Managing Memory Efficiently 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 63The next time the view property is accessed, the view is reloaded exactly as it was the first time. On iOS 5 and Earlier, the System May Unload Views When Memory Is Low In earlier versions of iOS, the system automatically attempts to unload a view controller’s views when memory is low. The steps that occur during the unload cycle are as follows: 1. The app receives a low-memory warning from the system. 2. Each view controller calls its didReceiveMemoryWarning method. If you override this method, you should use it to release any memory or objects that your view controller object no longer needs. You must call super at some point in your implementation to ensure that the default implementation runs. On iOS 5 and earlier, the default implementation attempts to release the view. On iOS 6 and later, the default implementation exits. 3. If the view cannot be safely released (for example, it is visible onscreen), the default implementation exits. 4. The view controller calls its viewWillUnload method. A subclass typically overrides this method when it needs to save any view properties before the views are destroyed. 5. It sets its view property to nil. 6. The view controller callsits viewDidUnload method. A subclasstypically overridesthis method to release any strong references it has to those views. Resource Management in View Controllers Managing Memory Efficiently 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 64Figure 4-3 shows a visual representation of the unload cycle for a view controller. Figure 4-3 Unloading a view from memory Resource Management in View Controllers Managing Memory Efficiently 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 65When the visibility of a view controller’s view changes, the view controller callssome built-in methodsto notify subclasses of the changes. You can override these methodsto override how yoursubclassreactsto the change. For example, you can use these notifications to change the color and orientation of the status bar so that it matches the presentation style of the view that is about to be displayed. Responding When a View Appears Figure 5-1 shows the sequence of events that occurs when a view controller’s view is added to a window’s view hierarchy. The viewWillAppear: and viewDidAppear: methods give subclasses a chance to perform any additional actions related to the appearance of the view. Figure 5-1 Responding to the appearance of a view 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 66 Responding to Display-Related NotificationsResponding When a View Disappears Figure 5-2 shows the sequence of events that occurs when a view is removed from its window. When the view controller detects that its view is about to be removed or hidden, it calls the viewWillDisappear: and viewDidDisappear: methods to give subclasses a chance to perform any relevant tasks. Figure 5-2 Responding to the disappearance of a view Determining Why a View’s Appearance Changed Occasionally, it can be useful to know why a view is appearing or disappearing. For example, you might want to know whether a view appeared because it was just added to a container or whether it appeared because some other content that obscured it wasremoved. This particular example often appears when using navigation controllers; your content controller’s view may appear because the view controller was just pushed onto the navigation stack or it might appear because controllers previously above it were popped from the stack. The UIViewController class provides methods your view controller can call to determine why the appearance change occurred. Table 5-1 describes the methods and their usage. These methods can be called from inside your implementation of the viewWillAppear:, viewDidAppear:, viewWillDisappear: and viewDidDisappear: methods. Responding to Display-Related Notifications Responding When a View Disappears 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 67Table 5-1 Methods to call to determine why a view’s appearance changed Method Name Usage You call this method inside your viewWillDisappear: and viewDidDisappear: methodsto determine if the view controller’s view is being hidden because the view controller was removed from its container view controller. isMovingFromParentViewController You call this method inside your viewWillAppear: and viewDidAppear: methods to determine if the view controller’s view is being shown because the view controller was just added to a container view controller. isMovingToParentViewController You call this method inside your viewWillAppear: and viewDidAppear: methods to determine if the view controller’s view is being shown because the view controller was just presented by another view controller. isBeingPresented You call this method inside your viewWillDisappear: and viewDidDisappear: methodsto determine if the view controller’s view is being hidden because the view controller was just dismissed. isBeingDismissed Responding to Display-Related Notifications Determining Why a View’s Appearance Changed 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 68A view controller owns its own view and manages the view’s contents. In the process, the view controller also manages the view’s subviews. But in most cases, the view’s frame is not set directly by the view controller. Instead, the view’s frame is determined by how the view controller’s view is displayed. More directly, it is configured by the object used to display it. Other conditions in the app, such as the presence of the status bar, can also cause the frame to change. Because of this, your view controller should be prepared to adjust the contents of its view when the view’s frame changes. A Window Sets the Frame of Its Root View Controller’s View The view associated with the window’s root view controller gets a frame based on the characteristics of the window. The frame set by the window can change based on a number of factors: ● The frame of the window ● Whether or not the status bar is visible ● Whether or not the status bar is showing additional transient information (such as when a phone call is in progress) ● The orientation of the user interface (landscape or portrait) ● The value stored in the root view controller’s wantsFullScreenLayout property If your app displays the status bar, the view shrinks so that it does not underlap the status bar. After all, if the status bar is opaque, there is no way to see or interact with the content lying underneath it. However, if your app displays a translucentstatus bar, you can set the value of your view controller’s wantsFullScreenLayout property to YES to allow your view to be displayed full screen. The status bar is drawn over the top of the view. Full screen is useful when you want to maximize the amount of space available for displaying your content. When displaying content under the status bar, place that content inside a scroll view so that the user can scroll it out from under the status bar. Being able to scroll your content isimportant because the user cannot interact with content that is positioned behind the status bar or any other translucent views (such as translucent navigation bars and toolbars). Navigation bars automatically add a scroll content inset to your scroll view (assuming it is the root view of your view controller) to account for the height of the navigation bar; otherwise, you must manually modify the contentInset property of your scroll view. 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 69 Resizing the View Controller’s ViewsA Container Sets the Frames of Its Children’s Views When a view controller is a child of a container view controller, its parent decides which children are visible. When it wants to show the view, it adds it as a subview in its own view hierarchy and sets its frame to fit it into its user interface. For example: ● A tab view controller reserves space at the bottom of its view for the tab bar. It sets the currently visible child’s view to use the remainder of the space. ● A navigation view controller reserves space at the top for the navigation bar. If the currently visible child wants a navigation bar to be displayed, it also places a view at the bottom of the screen. The remainder of its view is given to the child to fill. A child gets its frame from the parent all the way up to the root view controller, which gets its frame from the window. A Presented View Controller Uses a Presentation Context When a view controller is presented by another view controller, the frame it receivesis based on the presentation context used to display the view controller. See “Presentation Contexts Provide the Area Covered by the Presented View Controller” (page 95). A Popover Controller Sets the Size of the Displayed View A view controller displayed by a popover controller can determine the size of its view’s area by setting its own contentSizeForViewInPopover property value to the size it wants. If the popover controller sets its own popoverContentSize property to a different view size, its size value overrides the view controller’s setting. To match the model used by other view controllers, use the popover controller’s properties to control its size and position. How View Controllers Participate in the View Layout Process When the size of a view controller’s view changes, its subviews are repositioned to fit the new space available to them. The views in the controller’s view hierarchy perform most of this work themselves through the use of layout constraints and autoresizing masks. However, the view controller is also called at various points so that it can participate in the process. Here’s what happens: 1. The view controller’s view is resized to the new size. Resizing the View Controller’s Views A Container Sets the Frames of Its Children’s Views 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 702. If autolayout is not in use, the views are resized according to their autoresizing masks. 3. The view controller’s viewWillLayoutSubviews method is called. 4. The view’s layoutSubviews method is called. If autolayout is used to configure the view hierarchy, it updates the layout constraints by executing the following steps: a. The view controller’s updateViewConstraints method is called. b. The UIViewController class’simplementation of the updateViewConstraints method callsthe view’s updateConstraints method. c. After the layout constraints are updated, a new layout is calculated and the views are repositioned. 5. The view controller’s viewDidLayoutSubviews method is called. Ideally, the views themselves perform all of the necessary work to reposition themselves, without requiring the view controller to participate in the process at all. Often, you can configure the layout entirely within Interface Builder. However, if the view controller adds and removes views dynamically, a static layout in Interface Builder may not be possible. In this case, the view controller is a good place to control the process, because often the views themselves only have a limited picture of the other views in the scene. Here are the best approaches to this in your view controller: ● Use layout constraints to automatically position the views (iOS 6 and later). You override updateViewConstraints to add any necessary layout constraints not already configured by the views. Your implementation of this method must call [super updateViewConstraints]. For more information on layout constraints, see Cocoa Auto Layout Guide . ● Use a combination of autoresizing masks and code to manually position the views (iOS 5.x). You override layoutSubviews and use it to reposition any views whose positions cannot be set automatically through the use of resizing masks. For more information on the autoresizing properties of views and how they affect the view, see View Programming Guide for iOS . Resizing the View Controller’s Views How View Controllers Participate in the View Layout Process 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 71View controllers are descendants of the UIResponder class and are therefore capable of handling all sorts of events. When a view does not respond to a given event, it passes that event to its superview, traveling up the view hierarchy all the way to the root view. However, if any view in the chain is managed by a view controller, it passes the event to the view controller object before passing it up to the superview. In this way, the view controller can respond to events that are not handled by its views. If the view controller does not handle the event, that event moves on to the view’s superview as usual. The Responder Chain Defines How Events Are Propagated to the App Figure 7-1 demonstrates the flow of events within a view hierarchy. Suppose you have a custom view that is embedded inside a screen-sized generic view object, which in turn is managed by your view controller. Touch events arriving in your custom view’s frame are delivered to that view for processing. If your view does not 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 72 Using View Controllers in the Responder Chainhandle an event, it is passed along to the parent view. Because the generic view does not handle events, it passes those events along to its view controller first. If the view controller does not handle the event, the event isfurther passed along to the superview of the generic UIView object, which in this case isthe window object. Figure 7-1 Responder chain for view controllers Note: The message-passing relationship between a view controller and its view is managed privately by the view controller and cannot be programmatically modified by your app. Although you might not want to handle touch events specifically in your view controller, you could use it to handle motion-based events. You might also use it to coordinate the setting and changing of the first responder. For more information about how events are distributed and handled in iOS apps, see Event Handling Guide for iOS . Using View Controllers in the Responder Chain The Responder Chain Defines How Events Are Propagated to the App 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 73The accelerometers in iOS–based devices make it possible to determine the current orientation of the device. By default, an app supports both portrait and landscape orientations. When the orientation of an iOS–based device changes, the system sends out a UIDeviceOrientationDidChangeNotification notification to let any interested parties know that the change occurred. By default, the UIKit framework listens for this notification and uses it to update your interface orientation automatically. This means that, with only a few exceptions, you should not need to handle this notification at all. When the user interface rotates, the window is resized to match the new orientation. The window adjusts the frame of its root view controller to match the new size, and this size in turn is propagated down the view hierarchy to other views. Thus, the simplest way to support multiple orientations in your view controller is to configure its view hierarchy so that the positions of subviews are updated whenever its root view’s frame changes. In most cases, you already need this behavior because other conditions may cause the view controller’s visible area to change. For more information on configuring your view layout,see “Resizing the View Controller’s Views” (page 69). If the default behavior is not what you want for your app, you can take control over: ● The orientations supported by your app. ● How a rotation between two orientations is animated onscreen. View controllers that do not fill the screen usually should not care about the orientation of the user interface. Instead, fill the area provided by the parent view controller. A root view controller (or a view controller presented full screen) is more likely to be interested in the orientation of the device. 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 74 Supporting Multiple Interface OrientationsControlling What Interface Orientations Are Supported (iOS 6) When UIKit receives an orientation notification, it usesthe UIApplication object and the root view controller to determine whether the new orientation is allowed. If both objects agree that the new orientation issupported, then the user interface is rotated to the new orientation. Otherwise the device orientation is ignored. When a view controller is presented over the root view controller, the system behavior changes in two ways. First, the presented view controller is used instead of the root view controller when determining whether an orientation is supported. Second, the presented view controller can also provide a preferred orientation. If the view controller is presented full screen, the user interface is presented in the preferred orientation. The user is expected to see that the orientation is different from the device orientation and rotate the device. A preferred orientation is most often used when the content must be presented in the new orientation. Declaring a View Controller’s Supported Interface Orientations A view controller that acts as the root view controller of the main window or is presented full screen on the main window can declare what orientations it supports. It does this by overriding the supportedInterfaceOrientations method. By default, view controllers on devices that use the iPad idiom support all four orientations. On devices that use the iPhone idiom, all interface orientations but upside-down portrait are supported. You should always choose the orientations your view supports at design time and implement your code with those orientationsin mind. There is no benefit to choosing which orientations you want to support dynamically based on runtime information. Even if your app did this, you would still have to implement the necessary code to support all possible orientations,so you might as well just choose to support the orientation or not up front. Listing 8-3 shows a fairly typical implementation of the supportedInterfaceOrientations method for a view controller that supports the portrait orientation and the landscape-left orientation. Your own implementation of this method should be just as simple. Listing 8-1 Implementing the supportedInterfaceOrientations method - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft; } Supporting Multiple Interface Orientations Controlling What Interface Orientations Are Supported (iOS 6) 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 75Dynamically Controlling Whether Rotation Occurs Sometimes you may want to dynamically disable automatic rotation. For example, you might do this when you want to suppress rotation completely for a short period of time. You must temporarily disable orientation changes you want to manually control the position of the status bar (such as when you call the setStatusBarOrientation:animated: method). If you want to temporarily disable automatic rotation, avoid manipulating the orientation masks to do this. Instead, override the shouldAutorotate method on the topmost view controller. This method is called before performing any autorotation. If it returns NO, then the rotation is suppressed. Declaring a Preferred Presentation Orientation When a view controller is presented full-screen to show its content, sometimes the content appears best when viewed in a particular orientation in mind. If the content can only be displayed in that orientation, then you simply return that as the only orientation from your supportedInterfaceOrientations method. If the view controller supports multiple orientations but appears better in a different orientation, you can provide a preferred orientation by overriding the preferredInterfaceOrientationForPresentation method. Listing 8-2 shows an example used by a view controller whose content should be presented in landscape orientation. The preferred interface orientation must be one of the orientationssupported by the view controller. Listing 8-2 Implementing the preferredInterfaceOrientationForPresentation method - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationLandscapeLeft; } For more on presentation, see “Presenting View Controllers from Other View Controllers” (page 88). Declaring the App’s Supported Interface Orientations The easiest way to set an app’s app’s supported interface orientations is to edit the project’s Info.plist file. As in the case of the view controller, you define which of the four interface orientations are permitted. For more information, see Information Property List Key Reference . Supporting Multiple Interface Orientations Controlling What Interface Orientations Are Supported (iOS 6) 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 76If you restrict the app’s supported orientations, then those restrictions apply globally to all of the app’s view controllers, even when your app uses system view controllers. At any given time, the mask of the topmost view controller is logically ANDed with the app’s mask to determine what orientations are permitted. The result of this calculation must never be 0. If it is, the system throws a UIApplicationInvalidInterfaceOrientationException exception. Because the app’s mask is applied globally, use it sparingly. Important: The combination of the app and the view controller’s orientation masks must result in at least one useable orientation. An exception is thrown if there is no available orientation. Understanding the Rotation Process (iOS 5 and earlier) On iOS 5 and earlier, a view controller can sometimes participate in the rotation process even when it isn’t the topmost full-screen view controller. This generally occurs when a container view controller asks its children for their supported interface orientations. In practice, the ability for children to override the parents is rarely useful. With that in mind, you should consider emulating the iOS 6 behavior as much as possible in an app that must also support iOS 5: ● In a root view controller or a view controller that is presented full screen, choose a subset of interface orientations that make sense for your user interface. ● In a child controller, support all the default resolutions by designing an adaptable view layout. Declaring the Supported Interface Orientations To declare your supported interface orientations, override the shouldAutorotateToInterfaceOrientation:method and indicate which orientations your view supports. You should always choose the orientations your view supports at design time and implement your code with those orientationsin mind. There is no benefit to choosing which orientations you want to support dynamically based on runtime information. Even if you did so, you would still have to implement the necessary code to support all possible orientations, and so you might as well just choose to support the orientation or not up front. Listing 8-3 shows a fairly typical implementation of the shouldAutorotateToInterfaceOrientation: method for a view controller that supports the default portrait orientation and the landscape-left orientation. Your own implementation of this method should be just as simple. Supporting Multiple Interface Orientations Understanding the Rotation Process (iOS 5 and earlier) 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 77Listing 8-3 Implementing the shouldAutorotateToInterfaceOrientation: method - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation { if ((orientation == UIInterfaceOrientationPortrait) || (orientation == UIInterfaceOrientationLandscapeLeft)) return YES; return NO; } Important: You must always return YES for at least one interface orientation. If your app supports both landscape orientations, you can use the UIInterfaceOrientationIsLandscape macro as a shortcut, instead of explicitly comparing the orientation parameter against both landscape constants. The UIKit framework similarly defines a UIInterfaceOrientationIsPortrait macro to identify both variants of the portrait orientation. Responding to Orientation Changes in a Visible View Controller When a rotation occurs, the view controllers play an integral part of the process. Visible view controllers are notified at various stages of the rotation to give them a chance to perform additional tasks. You might use these methods to hide or show views, reposition or resize views, or notify other parts of your app about the orientation change. Because your custom methods are called during the rotation operation, you should avoid performing any time-consuming operations there. You should also avoid replacing your entire view hierarchy with a new set of views. There are better ways to provide unique views for different orientations, such as presenting a new view controller (as described in “Creating an Alternate Landscape Interface” (page 80)). The rotation methods are sent to the root view controller. The root view controller passes these events on as necessary to its children, and so on down the view controller hierarchy. Here is the sequence of events that occur when a rotation is triggered: 1. The window callsthe root view controller’s willRotateToInterfaceOrientation:duration:method. Container view controllers forward this message on to the currently displayed content view controllers. You can override this method in your custom content view controllersto hide views or make other changes to your view layout before the interface is rotated. Supporting Multiple Interface Orientations Responding to Orientation Changes in a Visible View Controller 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 782. The window adjusts the bounds of the view controller’s view. This causes the view to layout its subviews, triggering the view controller’s viewWillLayoutSubviews method. When this method runs, you can query the app object’s statusBarOrientation property to determine the current user interface layout. See “How View Controllers Participate in the View Layout Process” (page 70). 3. The view controller’s willAnimateRotationToInterfaceOrientation:duration: method is called. This method is called from within an animation block so that any property changes you make are animated at the same time as other animations that comprise the rotation. 4. The animation is executed. 5. The window calls the view controller’s didRotateFromInterfaceOrientation: method. Container view controllers forward this message to the currently displayed content view controllers. This action marks the end of the rotation process. You can use this method to show views, change the layout of views, or make other changes to your app. Figure 8-1 shows a visual representation of the preceding steps. It also shows how the interface looks at various stages of the process. Figure 8-1 Processing an interface rotation Supporting Multiple Interface Orientations Responding to Orientation Changes in a Visible View Controller 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 79Rotations May Occur When Your View Controller Is Hidden If your view controller’s contents are not onscreen when a rotation occurs, then it does not see the list of rotation messages. For example, consider the following sequence of events: 1. Your view controller presents another view controller’s contents full screen. 2. The user rotates the device so that the user interface orientation changes. 3. Your app dismisses the presented view controller. In this example, the presenting view controller was not visible when the rotation occurred, so it does not receive any rotation events. Instead, when it reappears, its views are simply resized and positioned using the normal view layout process. If your layout code needs to know the current orientation of the device, it can read the app object’s statusBarOrientation property to determine the current orientation. Creating an Alternate Landscape Interface If you want to present the same data differently based on whether a device is in a portrait or landscape orientation, the way to do so is using two separate view controllers. One view controller should manage the display of the data in the primary orientation (typically portrait), while the other manages the display of the data in the alternate orientation. Using two view controllers is simpler and more efficient than making major changes to your view hierarchy each time the orientation changes. It allows each view controller to focus on the presentation of data in one orientation and to manage things accordingly. It also eliminates the need to litter your view controller code with conditional checks for the current orientation. To support an alternate landscape interface, you must do the following: ● Implement two view controller objects. One to present a portrait-only interface, and the other to present a landscape-only interface. ● Register for the UIDeviceOrientationDidChangeNotification notification. In your handler method, present or dismiss the alternate view controller based on the current device orientation. Because view controllers normally manage orientation changesinternally, you have to tell each view controller to display itself in one orientation only. The implementation of the primary view controller then needsto detect device orientation changes and present the alternate view controller when the appropriate orientation change occurs. The primary view controller dismisses the alternate view controller when the orientation returns to the primary orientation. Supporting Multiple Interface Orientations Rotations May Occur When Your View Controller Is Hidden 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 80Listing 8-4 showsthe key methods you need to implement in a primary view controller thatsupports a portrait orientation. When the primary view controller is loaded from the storyboard, it registers to receive orientation-changed notifications from the shared UIDevice object. When such a notification arrives, the orientationChanged: method then presents or dismisses the landscape view controller depending on the current orientation. Listing 8-4 Presenting the landscape view controller @implementation PortraitViewController - (void)awakeFromNib { isShowingLandscapeView = NO; [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil]; } - (void)orientationChanged:(NSNotification *)notification { UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation; if (UIDeviceOrientationIsLandscape(deviceOrientation) && !isShowingLandscapeView) { [self performSegueWithIdentifier:@"DisplayAlternateView" sender:self]; isShowingLandscapeView = YES; } else if (UIDeviceOrientationIsPortrait(deviceOrientation) && isShowingLandscapeView) { [self dismissViewControllerAnimated:YES completion:nil]; isShowingLandscapeView = NO; } } Supporting Multiple Interface Orientations Creating an Alternate Landscape Interface 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 81Tips for Implementing Your Rotation Code Depending on the complexity of your views, you may need to write a lot of code to support rotations—or no code at all. When figuring out what you need to do, you can use the following tips as a guide for writing your code. ● Disable event delivery temporarily during rotations. Disabling event delivery for your views prevents unwanted code from executing while an orientation change is in progress. ● Store the visible map region. If your app contains a map view, save the visible map region value prior to beginning any rotations. When the rotations finish, use the saved value as needed to ensure that the displayed region is approximately the same as before. ● For complex view hierarchies, replace your views with a snapshot image. If animating large numbers of views is causing performance issues, temporarily replace those views with an image view containing an image of the viewsinstead. After the rotations are complete, reinstall your views and remove the image view. ● Reload the contents of any visible tables after a rotation. Forcing a reload operation when the rotations are finished ensures that any new table rows exposed are filled appropriately. ● Use rotation notifications to update your app’s state information. If your app usesthe current orientation to determine how to present content, use the rotation methods of your view controller (or the corresponding device orientation notifications) to note those changes and make any necessary adjustments. Supporting Multiple Interface Orientations Tips for Implementing Your Rotation Code 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 82Aside from managing a view’s behavior, a view controller can also help control an app’s accessibility. An accessible app is one that can be used by everyone, regardless of disability or physical impairment, while retaining its functionality and usability as a helpful tool. To be accessible, an iOS app must supply information about its user interface elements to VoiceOver users. VoiceOver, a screen-reading technology designed to assist the visually impaired, speaks aloud text, images, and UI controls displayed the screen, so that people who cannot see can still interact with these elements. UIKit objects are accessible by default, but there are still things you can do from the view controller’s perspective to address accessibility. At a high level, this means you should make sure that: ● Every user interface element users can interact with is accessible. Thisincludes elementsthat merely supply information, such as static text, as well as controls that perform actions. ● All accessible elements supply accurate and helpful information. In addition to these fundamentals, a view controller can enhance the VoiceOver user’s experience by setting the position of the VoiceOver focus ring programmatically, responding to special VoiceOver gestures, and observing accessibility notifications. Moving the VoiceOver Cursor to a Specific Element When the layout of a screen changes, the VoiceOver focus ring, also known as the VoiceOver cursor, resets its position to the first element displayed on the screen from left to right and top to bottom. You might decide to change the first element the VoiceOver cursor lands on when views are presented onscreen. For example, when a navigation controller pushes a view controller onto the navigation stack, the VoiceOver cursor falls on the Back button of the navigation bar. Depending on your app, it might make more sense to move it to the heading of the navigation bar instead, or to any other element. To do so, call UIAccessibilityPostNotification using both the notification UIAccessibilityScreenChangedNotification (which tells VoiceOver that the contents of the screen has changed) and the element you’d like to give focus to, as shown in Listing 9-1. 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 83 Accessibility from the View Controller’s PerspectiveListing 9-1 Posting an accessibility notification can change the first element read aloud @implementation MyViewController - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, self.myFirstElement); } @end If only the layout changes rather than the contents of the screen, such as when switching from portrait to landscape mode, use the notification UIAccessibilityLayoutChangedNotification instead of UIAccessibilityScreenChangedNotification. Note: Device rotation triggers a layout change, which resets the VoiceOver cursor’s position. Responding to Special VoiceOver Gestures There are special gestures that VoiceOver users can perform to trigger custom actions. These gestures are special because you are allowed to define their behavior, unlike standard VoiceOver gestures. You can detect the gestures by overriding certain methods in your views or view controllers. A gesture first checks the view that has VoiceOver focus for instruction and continues up the responder chain until it finds an implementation of the corresponding VoiceOver gesture method. If no implementation is found, the system default action for that gesture is triggered. For example, the Magic Tap gesture plays and pauses music playback from the Music app if no Magic Tap implementation is found from the current view to the app delegate. Although you can provide any custom logic you want, VoiceOver users expect the actions of these special gestures to follow certain guidelines. Like any gesture, your implementation of a VoiceOver gesture should follow a pattern so that interaction with an accessible app remains intuitive. There are five special VoiceOver gestures: ● Escape. A two-finger Z-shaped gesture that dismisses a modal dialog, or goes back one level in a navigation hierarchy. Accessibility from the View Controller’s Perspective Responding to Special VoiceOver Gestures 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 84● Magic Tap. A two-finger double-tap that performs the most-intended action. ● Three-Finger Scroll. A three-finger swipe that scrolls content vertically or horizontally. ● Increment and Decrement. A one-finger swipe up or down that adds or subtracts a given value from an element with the adjustable trait. Elements with the Adjustable accessibility trait must implement these methods. Note: All special VoiceOver gesture methods return a Boolean value that determine whether to propagate through the responder chain. To halt propagation, return YES; otherwise, return NO. Escape If you present a view that overlays content—such as a modal dialog or an alert—you should override the accessibilityPerformEscape method to dismiss the overlay. The function of the Escape gesture is like the function of the Esc key on a computer keyboard; it cancels a temporary dialog or sheet to reveal the main content. Another use case to override the Escape gesture would be to go back up one level in a navigation hierarchy. UINavigationController implements this functionality by default. If you’re designing your own kind of navigation controller, you should set the Escape gesture to traverse up one level of your navigation stack, because that is the functionality VoiceOver users expect. Magic Tap The purpose of the Magic Tap gesture isto quickly perform an often-used or most-intended action. For example, in the Phone app, it picks up or hangs up a phone call. In the Clock app, it starts and stops the stopwatch. If you want an action to fire from a gesture regardless of the view the VoiceOver cursor is on, you should implement the accessibilityPerformMagicTap method in your view controller. Note: If you’d like the Magic Tap gesture to perform the same action from anywhere within your app, it is more appropriate to implement the accessibilityPerformMagicTap method in your app delegate. Three-Finger Scroll The accessibilityScroll: method fires when a VoiceOver user performs a three-finger scroll. It accepts a UIAccessibilityScrollDirection parameter from which you can determine the direction of the scroll. If you have a custom scrolling view, it may be more appropriate to implement this on the view itself. Accessibility from the View Controller’s Perspective Responding to Special VoiceOver Gestures 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 85Increment and Decrement The accessibilityIncrement and accessibilityDecrement methods are required for elements with the adjustable trait and should be implemented on the views themselves. Observing Accessibility Notifications You can listen for accessibility notifications to trigger callback methods. Under certain circumstances, UIKit fires accessibility notifications which your app can observe to extend its accessible functionality. For example, if you listen for the notification UIAccessibilityAnnouncementDidFinishNotification, you can trigger a method to follow up the completion of VoiceOver’s speech. Apple does this in the iBooks app. iBooks fires a notification when VoiceOver finishes speaking a line in a book that triggers the next line to be spoken. If it is the last line on the page, the logic in the callback tells iBooks to turn the page and continue reading as soon as the last line ends speaking. This allows for a line-by-line degree of granularity for navigating text while providing a seamless, uninterrupted reading experience. To register as an observer for accessibility notifications, use the default notification center. Then create a method with the same name that you provide for the selector argument, as shown in Listing 9-2. Listing 9-2 Registering as an observer for accessibility notifications @implementation MyViewController - (void)viewDidLoad { [super viewDidLoad]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didFinishAnnouncement:) name:UIAccessibilityAnnouncementDidFinishNotification object:nil]; } - (void)didFinishAnnouncement:(NSNotification *)dict { NSString *valueSpoken = [[dict userInfo] objectForKey:UIAccessibilityAnnouncementKeyStringValue]; Accessibility from the View Controller’s Perspective Observing Accessibility Notifications 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 86NSString *wasSuccessful = [[dict userInfo] objectForKey:UIAccessibilityAnnouncementKeyWasSuccessful]; // ... } @end UIAccessibilityAnnouncementDidFinishNotification expects an NSNotification dictionary as a parameter from which you can determine the value spoken and whether or not the speaking has completed uninterrupted. Speaking may become interrupted if the VoiceOver user performs the stop speech gesture or swipes to another element before the announcement finishes. Another helpful notification to subscribe to is UIAccessibilityVoiceOverStatusChanged. It can detect when VoiceOver becomes toggled on or off. If VoiceOver is toggled outside of your app, you receive the notification when your app is brought back into the foreground. Because UIAccessibilityVoiceOverStatusChanged doesn’t expect any parameters, the method in your selector doesn’t need to append a trailing colon (:). For a full list of possible notifications you can observe, consult“Notifications”in UIAccessibility Protocol Reference . Remember that you may only observe the notifications that can be posted by UIKit, which are NSString objects, and not notifications that can be posted by your app, which are of type int. Accessibility from the View Controller’s Perspective Observing Accessibility Notifications 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 87The ability to present view controllers is a tool that you have at your disposal for interrupting the current workflow and displaying a new set of views. Most commonly, an app presents a view controller as a temporary interruption to obtain important information from the user. However, you can also use presented view controllers to implement alternate interfaces for your app at specific times. How View Controllers Present Other View Controllers A presented view controller is not a specific subclass of UIViewController (as UITabBarController or UINavigationController is). Instead, any view controller can be presented by your app. However, like tab bar and navigation controllers, you present view controllers when you want to convey a specific meaning about the relationship between the previous view hierarchy and the newly presented view hierarchy. When you present a modal view controller, the system creates a relationship between the view controller that did the presenting and the view controller that was presented. Specifically, the view controller that did the presenting updates its presentedViewController property to point to its presented view controller. 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 88 Presenting View Controllers from Other View ControllersSimilarly, the presented view controller updates its presentingViewController property to point back to the view controller that presented it. Figure 10-1 showsthe relationship between the view controller managing the main screen in the Calendar app and the presented view controller used to create new events. Figure 10-1 Presented views in the Calendar app. Any view controller object can present a single view controller at a time. This is true even for view controllers that were themselves presented by another view controller. In other words, you can chain presented view controllers together, presenting new view controllers on top of other view controllers as needed. Figure 10-2 shows a visual representation of the chaining process and the actions that initiate it. In this case, when the user taps the icon in the camera view, the app presents a view controller with the user’s photos. Tapping the action button in the photo library’s toolbar prompts the user for an appropriate action and then presents Presenting View Controllers from Other View Controllers How View Controllers Present Other View Controllers 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 89another view controller (the people picker) in response to that action. Selecting a contact (or canceling the people picker) dismisses that interface and takes the user back to the photo library. Tapping the Done button then dismisses the photo library and takes the user back to the camera interface. Figure 10-2 Creating a chain of modal view controllers Camera view controller Photo library navigation controller Action sheet People picker navigation controller present modally present modally Each view controller in a chain of presented view controllers has pointers to the other objects surrounding it in the chain. In other words, a presented view controller that presents another view controller has valid objects in both its presentingViewController and presentedViewController properties. You can use these relationships to trace through the chain of view controllers as needed. For example, if the user cancels the current operation, you can remove all objects in the chain by dismissing the first presented view controller. Dismissing a view controller dismisses not only that view controller but also any view controllers it presented. In Figure 10-2 (page 90), a point worth noting is that the presented view controllers are both navigation controllers. You can present UINavigationController objects in the same way that you would present a content view controller. When presenting a navigation controller, you always present the UINavigationController object itself, rather than presenting any of the view controllers on its navigation stack. However, individual view controllers on the navigation stack may present other view controllers, including other navigation controllers. Figure 10-3 Presenting View Controllers from Other View Controllers How View Controllers Present Other View Controllers 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 90shows more detail of the objects that are involved in the preceding example. As you can see, the people picker is not presented by the photo library navigation controller but by one of the content view controllers on its navigation stack. Figure 10-3 Presenting navigation controllers modally Presentation Styles for Modal Views For iPad apps, you can present content using several different styles. In iPhone apps, presented views always cover the visible portion of the window, but when running on an iPad, view controllers use the value in their modalPresentationStyle property to determine their appearance when presented. Different options for this property allow you to present the view controller so that it fills all or only part of the screen. Presenting View Controllers from Other View Controllers Presentation Styles for Modal Views 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 91Figure 10-4 shows the core presentation styles that are available. (The UIModalPresentationCurrentContext style lets a view controller adopt the presentation style of its parent.) In each presentation style, the dimmed areas show the underlying content but do not allow taps in that content. Therefore, unlike a popover, your presented views must still have controls that allow the user to dismiss the view. Figure 10-4 iPad presentation styles For guidance on when to use the different presentation styles, see “Popover (iPad Only)” in iOS Human Interface Guidelines. Presenting View Controllers from Other View Controllers Presentation Styles for Modal Views 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 92Presenting a View Controller and Choosing a Transition Style When a view controller is presented using a storyboard segue, it is automatically instantiated and presented. The presenting view controller can configure the destination view controller before it is presented. For more information, see “Configuring the Destination Controller When a Segue is Triggered” (page 101). If you need to present a view controller programmatically, you must do the following: 1. Create the view controller you want to present. 2. Set the modalTransitionStyle property of the view controller to the desired value. 3. Assign a delegate object to the view controller. Typically, the delegate is the presenting view controller. The delegate is used by the presented view controllers to notify the presenting view controller when it is ready to be dismissed. It may also communicate other information back to the delegate. 4. Call the presentViewController:animated:completion: method of the current view controller, passing in the view controller you want to present. The presentViewController:animated:completion: method presents the view for the specified view controller object and configures the presenting-presented relationships between the new view controller and the current view controller. Unless you are restoring your app to some previous state, you usually want to animate the appearance of the new view controller. The transition style you should use depends on how you plan to use the presented view controller. Table 10-1 lists the transition styles you can assign to the modalTransitionStyle property of the presented view controller and describes how you might use each one. Table 10-1 Transition styles for modal view controllers Transition style Usage Use this style when you want to interrupt the current workflow to gather information from the user. You can also use it to present content that the user might or might not modify. For thisstyle of transition, content view controllersshould provide buttons to dismissthe view controller explicitly. Typically, these are a Done button and an optional Cancel button. If you do not explicitly set a transition style, this style is used by default. UIModalTransitionStyleCoverVertical Use thisstyle to change the work mode of your app temporarily. The most common usage for this style is to display settings that might change frequently, such as in the Stocks and Weather apps. These settings can be meant for the entire app or they can be specific to the current screen. For this style of transition, you usually provide some sort of button to return the user to the normal running mode of your app. UIModalTransitionStyleFlipHorizontal Presenting View Controllers from Other View Controllers Presenting a View Controller and Choosing a Transition Style 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 93Transition style Usage Use this style to present an alternate interface when the device changes orientations. In such a case, your app is responsible for presenting and dismissing the alternate interface in response to orientation change notifications. Media-based apps can also use this style to fade in screens displaying media content. For an example of how to implement an alternate interface in response to device orientation changes, see “Creating an Alternate Landscape Interface” (page 80). UIModalTransitionStyleCrossDissolve Listing 10-1 shows how to present a view controller programmatically. When the user adds a new recipe, the app promptsthe user for basic information about the recipe by presenting a navigation controller. A navigation controller was chosen so that there would be a standard place to put a Cancel and Done button. Using a navigation controller also makes it easier to expand the new recipe interface in the future. All you would have to do is push new view controllers on the navigation stack. Listing 10-1 Presenting a view controller programmatically - (void)add:(id)sender { // Create the root view controller for the navigation controller // The new view controller configures a Cancel and Done button for the // navigation bar. RecipeAddViewController *addController = [[RecipeAddViewController alloc] init]; // Configure the RecipeAddViewController. In this case, it reports any // changes to a custom delegate object. addController.delegate = self; // Create the navigation controller and present it. UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:addController]; [self presentViewController:navigationController animated:YES completion: nil]; } Presenting View Controllers from Other View Controllers Presenting a View Controller and Choosing a Transition Style 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 94When the user taps either the Done or the Cancel button from the new recipe entry interface, the app dismisses the view controller and returns the user to the main view. See “Dismissing a Presented View Controller” (page 95). Presentation Contexts Provide the Area Covered by the Presented View Controller The area of the screen used to define the presentation area is determined by the presentation context. By default, the presentation context is provided by the root view controller, whose frame is used to define the frame of the presentation context. However, the presenting view controller, or any other ancestor in the view controller hierarchy, can choose to provide the presentation context instead. In that case, when another view controller provides the presentation context, its frame is used instead to determine the frame of the presented view. This flexibility allows you to limit the modal presentation to a smaller portion of the screen, leaving other content visible. When a view controller is presented, iOS searches for a presentation context. It starts at the presenting view controller by reading its definesPresentationContext property. If the value of this property is YES, then the presenting view controller defines the presentation context. Otherwise, it continues up through the view controller hierarchy until a view controller returns YES or until it reaches the window’s root view controller. When a view controller defines a presentation context, it can also choose to define the presentation style. Normally, the presented view controller determines how it presented using its modalTransitionStyle property. A view controller that sets definesPresentationContext to YES can also set providesPresentationContextTransitionStyle to YES. If providesPresentationContextTransitionStyle is set to YES, iOS uses the presentation context’s modalPresentationStyle to determine how the new view controller is presented. Dismissing a Presented View Controller When it comes time to dismiss a presented view controller, the preferred approach is to let the presenting view controller dismiss it. In other words, whenever possible, the same view controller that presented the view controller should also take responsibility for dismissing it. Although there are several techniques for notifying the presenting view controller that its presented view controller should be dismissed, the preferred technique is delegation. For more information, see “Using Delegation to Communicate with Other Controllers” (page 103). Presenting View Controllers from Other View Controllers Presentation Contexts Provide the Area Covered by the Presented View Controller 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 95Presenting Standard System View Controllers A number of standard system view controllers are designed to be presented by your app. The basic rules for presenting these view controllers are the same asthe rulesfor presenting your custom content view controllers. However, because your app does not have accessto the view hierarchy managed by the system view controllers, you cannotsimply implement actionsfor the controlsin the views. Interactions with the system view controllers typically take place through a delegate object. Each system view controller defines a corresponding protocol, whose methods you implement in your delegate object. Each delegate usually implements a method to either accept whatever item was selected or cancel the operation. Your delegate object should always be ready to handle both cases. One of the most important things the delegate must do is dismiss the presented view controller by calling the dismissModalViewControllerAnimated: method of the view controller that did the presenting (in other words, the parent of the presented view controller.) Table 10-2 lists several of the standard system view controllers found in iOS. For more information about each of these classes, including the features it provides, see the corresponding class reference documentation. Table 10-2 Standard system view controllers Framework View controllers ABNewPersonViewController ABPeoplePickerNavigationController ABPersonViewController ABUnknownPersonViewController Address Book UI EKEventEditViewController EKEventViewController Event Kit UI GKAchievementViewController GKLeaderboardViewController GKMatchmakerViewController GKPeerPickerController GKTurnBasedMatchmakerViewController Game Kit MFMailComposeViewController MFMessageComposeViewController Message UI MPMediaPickerController MPMoviePlayerViewController Media Player Presenting View Controllers from Other View Controllers Presenting Standard System View Controllers 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 96Framework View controllers UIImagePickerController UIVideoEditorController UIKit Note: Although the MPMoviePlayerController class in the Media Player framework might technically be thought of as a modal controller, the semantics for using it are slightly different. Instead of presenting the view controller yourself, you initialize it and tell it to play its media file. The view controller then handles all aspects of presenting and dismissing its view. (However, the MPMoviePlayerViewController class can be used instead of MPMoviePlayerController as a standard view controller for playing movies.) Presenting View Controllers from Other View Controllers Presenting Standard System View Controllers 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 97Few iOS apps show only a single screenful of content. Instead, they show some content when first launched and then show and hide other content in response to user actions. These transitions provide a single unified user interface that display a lot of content, just not all at once. By convention,smaller pieces of content are managed by different view controller classes. This coding convention allows you to create smaller and simpler controller classes that are easy to implement. However, dividing the work between multiple classesimposes additional requirements on your class designs. To maintain the illusion of a single interface, your view controllers must exchange messages and data to coordinate transitions from controller to another. Thus, even as your view controller classes look inwards to control views and perform the tasks assigned to them, they also look outwards to communicate with other collaborating view controllers. When Coordination Between View Controllers Occurs Communication between view controllers is tied to the role those view controllers play in your app. It would be impossible to describe all of the possible interactions between view controllers, because the number and nature of these relationships is dependent on the design of your app. However, it is possible to describe when these interactions occur and to give some examples of the kinds of coordination that might take place in your app. The lifetime of a view controller has three stages during which it might coordinate with other objects: View controller instantiation. In this stage, when a view controller is created, an existing view controller or another object was responsible for its creation. Usually, this object knows why the view controller was created and what task itshould perform. Thus, after a view controller isinstantiated, thisintent must be communicated to it. The exact details of this initial configuration vary. Sometimes, the existing view controller passes data objects to the new controller. At other times, it may configure the presentation style for that, or establish lasting links between the two view controllers. These links allow further communication later in the view controller’slifetime. During the view controller’s lifetime. In this stage, some view controllers communicate with other view controllers during their lifetime. The recipient of these messages could be the view controller that created it, peers with similar lifetimes, or even a new view controller that it itself created. Here are a few common designs: 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 98 Coordinating Efforts Between View Controllers● The view controllersends notificationsthat the user performed a specific action. Because thisis a notification, the object receiving this message is just being notified that something happened. ● The view controllersends data to another view controller. For example, a tab bar controller doesn’t establish a built-in relationship between its children, but your app might establish such a relationship when the tabs are displaying the same data object, just in different ways. When a user leaves one tab, the view controller associated with that tab sends the selection information to the view controller about to be displayed. In return, the new view controller uses this data to configure its views so that the transition appears seamless. In this particular case, no new view controller is instantiated by the action. Instead, the two view controllers are peers with the same lifetime and can continue to coordinate as the user switches between them. ● A view controller sends messages to give another view controller authority over its actions. For example, if a view controller allows usersto enter data, it mightsend messagesto allow another controller to decide whether the data the user entered is valid. If the data is invalid, the view controller can disallow the user from accepting the invalid data or adjust its interface to display an error. View controller destruction. In this stage, many view controllers send messages when their task completes. These messages are common because the convention is for the controller that created a view controller to also release it. Sometimes, these messages simply convey that the user finished the task. At other times, such as when the task being performed generated new data objects, the message communicatesthe new data back to another controller. During a view controller’s lifetime, it is common for it to exchange information with other view controllers. These messages are used to notify other controllers when things happen, send them data, or even ask them to exert control over the controller’s activities. With Storyboards, a View Controller is Configured When It Is Instantiated Storyboards provide direct support for configuring newly instantiated controllers before they are displayed. When a storyboard instantiates new view controllers automatically, it calls an object in your app to allow it to configure the new controller or to create links to or from the new controller. When your app first launches, the app delegate configures the initial view controller. When a segue is triggered, the source view controller configures the destination view controller. There are a few conventions used to implement destination view controllers: ● A destination view controller exposes properties and methods used to configure it. Coordinating Efforts Between View Controllers With Storyboards, a View Controller is Configured When It Is Instantiated 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 99● A destination view controller communicates as little as possible with view controllers that it did not create personally. When it does so, these communication paths should use delegation. The destination view controller’s delegate is configured as one of its properties. Carefully following these conventions helps organize your configuration code and carefully limitsthe direction of dependencies between view controller classes in your app. By isolating dependencies in your app, you increase the opportunity for code reuse. You also design view controllers that are easier to test in isolation from the rest of your app. Configuring the Initial View Controller at Launch If you define a main storyboard in your project, iOS automatically does a lot of work for you to set up your app. When your app calls the UIApplicationMain function, iOS performs the following actions: 1. It instantiates the app delegate based on the class name you passed into the UIApplicationMain function. 2. It creates a new window attached to the main screen. 3. If your app delegate implements a window property, iOS sets this property to the new window. 4. It loads the main storyboard referenced in the app’s information property list file. 5. It instantiates the main storyboard’s initial view controller. 6. It sets the window’s rootViewController property to the new view controller. 7. It calls the app delegate’s application:didFinishLaunchingWithOptions: method. Your app delegate is expected to configure the initial view controller (and its children, if it is a container view controller). 8. It calls the window’s makeKeyAndVisible method to display the window. Listing 11-1 shows an implementation of the application:didFinishLaunchingWithOptions: method from the Your Second iOS App: Storyboards tutorial. In this example, the storyboard’s initial view controller is a navigation controller with a custom content controller that displays the master view. The code first retrieves references to the view controller it is interested in. Then, it performs any configuration that could not be performed in Interface Builder. In this example, a custom data controller object is provided to the master view controller by a custom data controller object. Listing 11-1 The app delegate configures the controller - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { Coordinating Efforts Between View Controllers With Storyboards, a View Controller is Configured When It Is Instantiated 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 100UINavigationController *navigationController = (UINavigationController*) self.window.rootViewController; BirdsMasterViewController * firstViewController = [[navigationController viewControllers] objectAtIndex:0]; BirdSightingDataController *dataController = [[BirdSightingDataController alloc] init]; firstViewController.dataController = dataController; return YES; } If your project does not identify the main storyboard, the UIApplicationMain function creates the app delegate and calls it but does not perform any of the other steps described earlier. You would need to write code to perform those steps yourself. Listing 11-2 shows the code you might implement if you needed to perform these steps programmatically. Listing 11-2 Creating the window when a main storyboard is not being used - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MyStoryboard" bundle:nil]; MainViewController *mainViewController = [storyboard instantiateInitialViewController]; self.window.rootViewController = mainViewController; // Code to configure the view controller goes here. [self.window makeKeyAndVisible]; return YES; } Configuring the Destination Controller When a Segue is Triggered iOS performs the following tasks when a segue is triggered: Coordinating Efforts Between View Controllers With Storyboards, a View Controller is Configured When It Is Instantiated 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 1011. It instantiates the destination view controller. 2. It instantiates a new segue object that holds all the information for the segue being triggered. Note: A popover segue also provides a property that identifies the popover controller used to control the destination view controller. 3. It callsthe source view controller’s prepareForSegue:sender: method, passing in the new segue object and the object that triggered the segue. 4. It callsthe segue’s perform method to bring the destination controller onto the screen. The actual behavior depends on the kind ofsegue being performed. For example, a modalsegue tellsthe source view controller to present the destination view controller. 5. It releases the segue object and the segue is complete. The source view controller’s prepareForSegue:sender: method performs any necessary configuration of the destination view controller’s properties, including a delegate if the destination view controller implements one. Listing 11-3 shows an implementation of the prepareForSegue:sender: method from the Your Second iOS App: Storyboards tutorial. Listing 11-3 Configuring the destination controller in a segue - (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"ShowSightingsDetails"]) { DetailViewController *detailViewController = [segue destinationViewController]; detailViewController.sighting = [self.dataController objectInListAtIndex:[self.tableView indexPathForSelectedRow].row]; } if ([[segue identifier] isEqualToString:@"ShowAddSightingView"]) { AddSightingViewController *addSightingViewController = [[[segue destinationViewController] viewControllers] objectAtIndex:0]; addSightingViewController.delegate = self; Coordinating Efforts Between View Controllers With Storyboards, a View Controller is Configured When It Is Instantiated 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 102} } This implementation, from the master view controller for the app, actually handles two different segues configured in the storyboard. It distinguishes between the two segues using the segue’s identifier property. In both cases, it follows the coding convention established earlier, by first retrieving the view controller and then configuring it. When the segue is to the detail view controller, the segue occurred because the user selected a row in the table view. In this case, the code transfers enough data to the destination view controllerso that the destination view controller can display the sighting. The code uses the user’s selection to retrieve a sighting object from the master view controller’s data controller. It then assigns this sighting to the destination controller. In the other case, the new view controller allows the user to add a new bird sighting. No data needs to be sent to this view controller. However, the master view controller needs to receive data when the user finishes entering the data. To receive that information, the source view controller implements the delegate protocol defined by the Add view controller (notshown here) and makesitself the destination view controller’s delegate. Using Delegation to Communicate with Other Controllers In a delegate-based model, the view controller defines a protocol for its delegate to implement. The protocol defines methods that are called by the view controller in response to specific actions, such as taps in a Done button. The delegate is then responsible for implementing these methods. For example, when a presented view controller finishesitstask, itsends a message to the presenting view controller and that controller dismisses it. Using delegation to manage interactions with other app objects has key advantages over other techniques: ● The delegate object has the opportunity to validate or incorporate changes from the view controller. ● The use of a delegate promotes better encapsulation because the view controller does not have to know anything about the class of the delegate. This enables you to reuse that view controller in other parts of your app. To illustrate the implementation of a delegate protocol, consider the recipe view controller example that was used in “Presenting a View Controller and Choosing a Transition Style” (page 93). In that example, a recipes app presented a view controller in response to the user wanting to add a new recipe. Prior to presenting the view controller, the current view controller made itself the delegate of the RecipeAddViewController object. Listing 11-4 shows the definition of the delegate protocol for RecipeAddViewController objects. Coordinating Efforts Between View Controllers Using Delegation to Communicate with Other Controllers 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 103Listing 11-4 Delegate protocol for dismissing a presented view controller @protocol RecipeAddDelegate // recipe == nil on cancel - (void)recipeAddViewController:(RecipeAddViewController *)recipeAddViewController didAddRecipe:(MyRecipe *)recipe; @end When the user taps the Cancel or Done button in the new recipe interface, the RecipeAddViewController object calls the preceding method on its delegate object. The delegate is then responsible for deciding what course of action to take. Listing 11-5 shows the implementation of the delegate method that handles the addition of new recipes. This method is implemented by the view controller that presented the RecipeAddViewController object. If the user accepted the new recipe—that is, the recipe object is not nil—this method addsthe recipe to itsinternal data structures and tells its table view to refresh itself. (The table view subsequently reloads the recipe data from the same recipesController object shown here.) Then the delegate method dismisses the presented view controller. Listing 11-5 Dismissing a presented view controller using a delegate - (void)recipeAddViewController:(RecipeAddViewController *)recipeAddViewController didAddRecipe:(Recipe *)recipe { if (recipe) { // Add the recipe to the recipes controller. int recipeCount = [recipesController countOfRecipes]; UITableView *tableView = [self tableView]; [recipesController insertObject:recipe inRecipesAtIndex:recipeCount]; [tableView reloadData]; } [self dismissViewControllerAnimated:YES completion: nil]; } Coordinating Efforts Between View Controllers Using Delegation to Communicate with Other Controllers 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 104Guidelines for Managing View Controller Data Carefully managing how data and control flows between your view controllersis critical to understanding how your app operates and avoiding subtle errors. Consider the following guidelines when designing your view controllers: ● A destination view controller’s references to app data should come from the source view controller unless the destination view controller represents a self-contained (and therefore self-configuring) view controller. ● Perform as much configuration as possible using Interface Builder, rather than configuring your controller programmatically in your code. ● Always use a delegate to communicate information back to other controllers. Your content view controller should never need to know the class of the source view controller or any controllers it doesn’t create. ● Avoid unnecessary connections to objects external to your view controller. Each connection represents a dependency that makes it harder to change your app design. For example, the children of a navigation controller should be aware of the parent navigation controller and of the siblings immediately above and below them on the stack. They rarely need to communicate with other siblings. Coordinating Efforts Between View Controllers Guidelines for Managing View Controller Data 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 105You can use the same view controller both to display and to edit content. When the editing mode is toggled, your custom view controller performs the necessary work to transition its view from a display mode to an editing mode (or vice versa). Toggling Between Display and Edit Mode To allow a custom view controller class to be used to both display and edit content, override the setEditing:animated: method. When called, your implementation of this method should add, hide, and adjust the view controller’s views to match the specified mode. For example, you might want to change the content or appearance of views to convey that the view is now editable. If your view controller manages a table, you can also call the table’s own setEditing:animated: method in order to put the table into the appropriate mode. 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 106 Enabling Edit Mode in a View ControllerNote: You typically do not swap out your entire view hierarchy when toggling back and forth between display and edit modes. The point of using the setEditing:animated: method is so that you can make small changes to existing views. If you would prefer to display a new set of views for editing, you should either present a new view controller or use a navigation controller to present the new views. Figure 12-1 shows a view from the Contacts app that supports in-place editing. Tapping the Edit button in the upper-right corner tells the view controller to update itself for editing; the Done button returns the user to display mode. In addition to modifying the table, the view also changes the content of the image view and the view displaying the user’s name. It also configures the assorted views and cells so that tapping them edits their contents instead of performing other actions. Figure 12-1 Display and edit modes of a view The implementation of your own setEditing:animated: method is relatively straightforward—you check to see which mode your view controller is entering and adjust the contents of your view accordingly. - (void)setEditing:(BOOL)flag animated:(BOOL)animated { Enabling Edit Mode in a View Controller Toggling Between Display and Edit Mode 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 107[super setEditing:flag animated:animated]; if (flag == YES){ // Change views to edit mode. } else { // Save the changes if needed and change the views to noneditable. } } Presenting Editing Options to the User A common place in which to use an editable view is in a navigation interface. When implementing your navigation interface, you can include a special Edit button in the navigation bar when your editable view controller is visible. (You can get this button by calling the editButtonItem method of your view controller.) When tapped, this button automatically toggles between an Edit and Done button and calls your view controller’s setEditing:animated: method with appropriate values. You can also call this method from your own code (or modify the value of your view controller’s editing property) to toggle between modes. For more information about adding an Edit button to a navigation bar, see View Controller Catalog for iOS . Enabling Edit Mode in a View Controller Presenting Editing Options to the User 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 108Interface Builder provides segues for all of the standard ways to transition from one view controller to another—from presenting a view controller to displaying a controller in a popover. However, if one of those segues doesn’t do what you want, you can create a custom segue. The Life Cycle of a Segue To understand how custom segues work, you need to understand the life cycle of a segue object. Segue objects are instances of UIStoryboardSegue or one of its subclasses. Your app never creates segue objects directly; they are always created on your behalf by iOS when a segue is triggered. Here’s what happens: 1. The destination controller is created and initialized. 2. The segue object is created and its initWithIdentifier:source:destination: method is called. The identifier is the unique string you provided for the segue in Interface Builder, and the two other parameters represent the two controller objects in the transition. 3. The source view controller’s prepareForSegue:sender: method is called. See “Configuring the Destination Controller When a Segue is Triggered” (page 101). 4. The segue object’s perform method is called. This method performs a transition to bring the destination view controller on-screen. 5. The reference to the segue object is released, causing it to be deallocated. Implementing a Custom Segue To implement a custom segue, you subclass UIStoryboardSegue and implement the two methods described earlier: ● If you override the initWithIdentifier:source:destination: method, call the superclass’s implementation, then initialize your subclass. ● Your perform method must make whatever view controller calls are necessary to perform the transition you want. Typically, you use any of the standard ways to display a new view controller, but you can embellish this design with animations and other effects. 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 109 Creating Custom SeguesNote: If your implementation adds properties to configure the segue, you cannot configure these attributes in Interface Builder. Instead, configure the custom segue’s additional properties in the prepareForSegue:sender: method of the source view controller that triggered the segue. “Creating Custom Segues” shows a very simple custom segue. This example simply presents the destination view controller without any sort of animation, but you can extend this idea with your own animations as necessary. Listing 13-1 A custom segue - (void)perform { // Add your own animation code here. [[self sourceViewController] presentModalViewController:[self destinationViewController] animated:NO]; } Creating Custom Segues Implementing a Custom Segue 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 110Container view controllers are a critical part of iOS app design. They allow you to decompose your app into smaller and simpler parts, each controlled by a view controller dedicated to that task. Containers allow these view controllers to work together to present a seamless interface. iOS provides many standard containers to help you organize your apps. However, sometimes you need to create a custom workflow that doesn’t match that provided by any of the system containers. Perhaps in your vision, your app needs a specific organization of child view controllers with specialized navigation gestures or animation transitions between them. To do that, you implement a custom container. Designing Your Container View Controller In most ways, a container view controller is just like a content view controller. It manages views and content, coordinates with other objects in your app, and responds to events in the responder chain. Before designing a container controller, you should already be familiar with designing content view controllers. The design questions in “Creating Custom Content View Controllers” (page 43) also apply when creating containers. When you design a container, you create explicit parent-child relationships between your container, the parent, and other view controllers, its children. More specifically, Figure 14-1 shows that there are explicit connections between the views as well. Your container adds the content views of other view controllers in its own view 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 111 Creating Custom Container View Controllershierarchy. Whenever a child’s view is displayed in the container’s view hierarchy, your container also establishes a connection to the child view controller and ensures that all appropriate view controller events are sent to the child. Figure 14-1 A container view controller’s view hierarchy contains another controller’s views Your containershould make the rules and its children should follow them; it is up to the parent to decide when a child’s content is visible in its own view hierarchy. The container decides where in the hierarchy that view is placed and how it is sized and positioned there. This design principle is no different from that of a content view controller. The view controller isresponsible for managing its own view hierarchy and other classesshould never manipulate its contents. Where necessary, your container class can expose public methods and properties to allow its behavior to be controlled. For example, if another object needs to be able to tell your container to display a new view, then your container class should expose a public method to allow this transition to occur. The actual implementation that changes the view hierarchy should be in the container class. This guiding principle cleanly separates responsibilities between the container and its children by always making each view controller responsible for its own view hierarchy. Here are some specific questions you should be able to answer about your container class: ● What is the role of the container and what role do its children play? ● Is there a relationship between siblings? ● How are child view controllers added to or removed from the container? Your container class must provide public properties and methods to allow children to be displayed by it. ● How many children are displayed by the container? Creating Custom Container View Controllers Designing Your Container View Controller 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 112● Are the contents of the container static or dynamic? In a static design, the children are more or less fixed, whereasin a dynamic design, transitions between siblings may occur. You define what triggers a transition to a new sibling. It might be programmatic or it might happen when a user interacts with the container. ● Does the container own any of its own views? For example, your container’s user interface may include information about the child view controller or controls to allow navigation. ● Does the container require its children to provide methods or properties other than those found on the UIViewController class? There are many reasons why a container might do this. It might need specific information from the child to used to configure other aspects of container display, or it might allow the child to modify the container’s behavior. It even might call the child view controller when container-specific events occur. ● Does your container allow its behavior to be configured? ● Are all its children treated identically or does it have multiple types of children, each with specialized behaviors? For example, you might create a container that displays two children, coordinating actions between the two children. Each child implements a distinct set of methods to allow its behavior to be configured. In summary, a container controller often has more relationships with other objects (especially other view controllers) than a content controller. So, you need to put additional effort into understanding how the container works. Ideally, as with a content controller, you want to hide many of those behaviors behind an excellent public class API. Examples of Common Container Designs The easiest way to understand how to design a new container class is to examine the behavior and public API of the existing system container classes. Each definesits own navigation metaphor and a programming interface used to configure it. This section takes a look at a few of these classes from the viewpoint of container design. It does not provide a complete description of each class’s programming interface, but just looks at some of the critical concepts. For detailed information about using these system containers,see ViewController Catalog for iOS . A Navigation Controller Manages a Stack of Child View Controllers A navigation controller allows a sequence of distinct user interface screens to be displayed to the user. The metaphor used by a navigation controller is a stack of child view controllers. The topmost view controller’s view is placed in the navigation controller’s view hierarchy. To display a new view controller, you push it onto the stack. When you are done, you remove the view controller from the stack. Creating Custom Container View Controllers Examples of Common Container Designs 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 113Figure 14-2 shows that only a single child’s view is visible and that the child’s view is part of a more complex hierarchy of views provided by the navigation controller. Figure 14-2 A navigation controller’s view and view controller hierarchy When a view controller is pushed onto or popped from the stack, the transition can be animated, which means the views of two children are briefly displayed together. In addition to the child views, a navigation controller also includes its own content views to display a navigation bar. The contents of the navigation bar are updated based on the child being displayed. Here are some of the important methods and properties that the UINavigationController class uses to define its behavior: ● The topViewController property states which controller is at the top of the stack. ● The viewControllers property lists all the children in the stack. ● The pushViewController:animated: method pushes a new view controller on the stack. This method does all the work necessary to update the view hierarchy to display the new child’s view. ● The popViewControllerAnimated: method removes the top view controller from the stack. ● The delegate property allows a client of the container to be notified when state transitions occur. The navigation controller uses properties on the child view controller to adjust the content it displays. These properties are defined by UIViewController base classso thatsome default behavior is available; this allows any view controller to be made a child of a navigation controller. Here are some of the propertiesthe navigation controller looks for: Creating Custom Container View Controllers Examples of Common Container Designs 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 114● The navigationItem property provides the contents of the navigation toolbar. ● The toolbarItems property provides the contents of the bottom bar. ● The editButtonItem property provides access to a view in the navigation item so that the navigation controller can toggle the child view’s edit mode. A Tab Bar Controller Uses a Collection of Child Controllers A tab view controller allows a set of distinct user interface screensto be displayed to the user. However, instead of a stack of view controllers, a tab view controller uses a simple array. Figure 14-3 shows that again, only one child view controller’s view is displayed at a time. However, these views do not need to be accessed sequentially, and the transition to the new child is usually not animated. Figure 14-3 A tab bar controller’s view and view controller hierarchy Here are some of the important methods and properties that UITabBarController class uses to allow apps to control what a tab bar controller displays: ● The viewControllers property holds the list of child view controllers that act as the tabs of content. ● The selectedViewController property allows you to read or change which child is visible. ● The delegate property allows a client of the container to be notified when state transitions occur. A tab bar controller uses the child’s tabBarItem property to determine how it is displayed in the appropriate tab. Creating Custom Container View Controllers Examples of Common Container Designs 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 115A Page Controller Uses a Data Source to Provide New Children A page controller uses pages of content as its metaphor, like the pages of a book. Each page displayed by the container is provided by a child view controller. Books can have many pages—far more than the number of screens of content in a navigation controller—so keeping all the pages in memory at once may not be possible. Instead, the page view controller keeps child controllers for the visible pages and fetches other pages on demand. When the user wants to see a new page, the container calls the object associated with its dataSource property to get the new controller. Thus, a page view controller using a data source uses a pull model rather than having your app directly push new pages onto itself. A page view controller can also be customized for different kinds of book layouts. The number of pages and the size of the pages can differ. Here are two key properties that affect the page view controller’s behavior: ● The spineLocation property determines how the pages are organized. Some layouts only display one page at a time. Other layouts display multiple pages. ● The transitionStyle property determines how transitions between pages are animated. Implementing a Custom Container View Controller Once you’ve designed your class’s behavior and determined many aspects of its public API, you are ready to start implementing the container. The goal of implementing a container is to be able to add another view controller’s view (and associated view hierarchy) as a subtree in your container’s view hierarchy. The child remainsresponsible for its own view hierarchy,save for where the container decidesto place it onscreen. When you add the child’s view, you need to ensure that events continue to be distributed to both view controllers. You do this by explicitly associating the new view controller as a child of the container. The UIViewController class provides methods that a container view controller uses to manage the relationship between itself and its children. The complete list of methods and properties is in the reference; see “Managing Child View Controllers in a Custom Container” in UIViewController Class Reference Important: These UIViewController methods are only intended to be used to implement container view controllers; do not call them in a content view controller. Adding and Removing a Child Listing 14-1 shows a typical implementation that adds a view controller as a child of another view controller. Each numbered step in the listing is described in more detail following the listing. Creating Custom Container View Controllers Implementing a Custom Container View Controller 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 116Listing 14-1 Adding another view controller’s view to the container’s view hierarchy - (void) displayContentController: (UIViewController*) content; { [self addChildViewController:content]; // 1 content.view.frame = [self frameForContentController]; // 2 [self.view addSubview:self.currentClientView]; [content didMoveToParentViewController:self]; // 3 } Here’s what the code does: 1. It calls the container’s addChildViewController: method to add the child. Calling the addChildViewController: method also calls the child’s willMoveToParentViewController: method automatically. 2. It accessesthe child’s view property to retrieve the view and addsit to its own view hierarchy. The container sets the child’s size and position before adding the view; containers always choose where the child’s content appears. Although this example doesthis by explicitly setting the frame, you could also use layout constraints to determine the view’s position. 3. It explicitly calls the child’s didMoveToParentViewController: method to signal that the operation is complete. Eventually, you want to be able to remove the child’s view from the view hierarchy. In this case, shown in Listing 14-2, you perform the steps in reverse. Listing 14-2 Removing another view controller’s view to the container’s view hierarchy - (void) hideContentController: (UIViewController*) content { [content willMoveToParentViewController:nil]; // 1 [content.view removeFromSuperview]; // 2 [content removeFromParentViewController]; // 3 } Here’s what this code does: 1. Callsthe child’s willMoveToParentViewController: method with a parameter of nil to tell the child that it is being removed. 2. Cleans up the view hierarchy. Creating Custom Container View Controllers Implementing a Custom Container View Controller 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 1173. Calls the child’s removeFromParentViewController method to remove it from the container. Calling the removeFromParentViewController method automatically calls the child’s didMoveToParentViewController: method. For a container with essentially static content, adding and removing view controllers is as simple as that. Whenever you want to add a new view, add the new view controller as a child first. After the view is removed, remove the child from the container. However, sometimes you want to animate a new child onto the screen while simultaneously removing another child. Listing 14-3 shows an example of how to do this. Listing 14-3 Transitioning between two view controllers - (void) cycleFromViewController: (UIViewController*) oldC toViewController: (UIViewController*) newC { [oldC willMoveToParentViewController:nil]; // 1 [self addChildViewController:newC]; newC.view.frame = [self newViewStartFrame]; // 2 CGRect endFrame = [self oldViewEndFrame]; [self transitionFromViewController: oldC toViewController: newC // 3 duration: 0.25 options:0 animations:^{ newC.view.frame = oldC.view.frame; // 4 oldC.view.frame = endFrame; } completion:^(BOOL finished) { [oldC removeFromParentViewController]; // 5 [newC didMoveToParentViewController:self]; }]; } Here’s what this code does: 1. Starts both view controller transitions. 2. Calculates two new frame positions used to perform the transition animation. Creating Custom Container View Controllers Implementing a Custom Container View Controller 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 1183. Calls the transitionFromViewController:toViewController:duration:options:animations:completion: method to perform the swap. This method automatically adds the new view, performs the animation, and then removes the old view. 4. The animation step to perform to get the views swapped. 5. When the transition completes, the view hierarchy isin itsfinalstate,so it finishesthe operation by sending the final two notifications. Customizing Appearance and Rotation Callback Behavior Once you add a child to a container, the container automatically forwards rotation and appearance callbacks to the child view controllers as soon as an event occurs that requires the message to be forwarded. This is normally the behavior you want, because it ensures that all events are properly sent. However, sometimes the default behavior may send those events in an order that doesn’t make sense for your container. For example, if multiple children are simultaneously changing their view state, you may want to consolidate the changes so that the appearance callbacks all happen at the same time in a more logical order. To do this, you modify your container class to take over responsibility for appearance or rotation callbacks. To take over control of appearance callbacks, you override the shouldAutomaticallyForwardAppearanceMethodsmethod to return NO. Listing 14-4 showsthe necessary code. Listing 14-4 Disabling automatic appearance forwarding - (BOOL) shouldAutomaticallyForwardAppearanceMethods { return NO; } To actually inform the child view controller that an appearance transition is occurring, you call the child’s beginAppearanceTransition:animated: and endAppearanceTransition methods. If you take over sending these messages, you are also responsible for forwarding them to children when your container view controller appears and disappears. For example, if your container has a single child referenced by a child property, your container would forward these messages to the child, as shown in Listing 14-5. Listing 14-5 Forwarding appearance messages when the container appears or disappears -(void) viewWillAppear:(BOOL)animated { Creating Custom Container View Controllers Implementing a Custom Container View Controller 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 119[self.child beginAppearanceTransition: YES animated: animated]; } -(void) viewDidAppear:(BOOL)animated { [self.child endAppearanceTransition]; } -(void) viewWillDisappear:(BOOL)animated { [self.child beginAppearanceTransition: NO animated: animated]; } -(void) viewDidDisappear:(BOOL)animated { [self.child endAppearanceTransition]; } Forwarding rotation events works almost identically and can be done independently of forwarding appearance messages. First, you override the shouldAutomaticallyForwardRotationMethods method to return NO. Then, at times appropriate to your container, you call the following methods: ● willRotateToInterfaceOrientation:duration: ● willAnimateRotationToInterfaceOrientation:duration: ● didRotateFromInterfaceOrientation: Practical Suggestions for Building a Container View Controller Designing, developing, and testing a new container view controller takestime. Although the individual behaviors are straightforward, the controller as a whole can be quite complex. Consider some of the following guidance when implementing your own container classes: ● Design the view controller first as a content view controller, using regular views owned by the container. This allows you to focus on getting layout and animation transitions correct without simultaneously needing to manage parent-child relationships. Creating Custom Container View Controllers Practical Suggestions for Building a Container View Controller 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 120● Never access any view other than the top-level view of the child view controller. Similarly, children should have only a minimal knowledge of what the parent is doing with the view; do not expose unnecessary details to the child. ● If the container needs the child to declare methods or properties, it should define a protocol to enforce this: @protocol MyContentContainerProtocol ... @end - (void) displayContentController: (UIViewController*) content; Creating Custom Container View Controllers Practical Suggestions for Building a Container View Controller 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 121This table describes the changes to View Controller Programming Guide for iOS . Date Notes Added design guidelines for custom container view controllers and accessibility in the view controller. Updated the discussions of view rotation, view layout, and resource management for iOS 6. 2012-09-19 Edited for clarity. Added new glossary entries. Added a section about determining why a view controller's view appeared or disappeared. 2012-02-16 This revised treatment has been rewritten around using storyboards and ARC to build new iOS apps. 2012-01-09 2011-01-07 Fixed several typos. 2010-11-12 Added information about iPad-only controller objects. Changed the title from "View Controller Programming Guide for iPhone OS." 2010-07-08 2010-05-03 Fixed some typos. Fixed several typos and updated the figure for the two-step rotation process. 2010-02-24 Rewrote the document and expanded the content to address iOS 3.0 changes. 2009-10-19 2009-05-28 Added a note about the lack of iOS 3.0 support. 2008-10-15 Updated obsolete references to the iOS Programming Guide. 2008-09-09 Corrected typos. 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 122 Document Revision HistoryDate Notes New document that explains how to use view controllers to implement radio, navigation, and modal interfaces. 2008-06-23 Document Revision History 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 123container view controller A view controller that coordinatesthe interaction of other view controllers in order to present a specific type of user interface. content view controller A view controller that displays some content on the screen. custom segue A segue whose transition effect is defined by a custom subclass. modal segue A segue whose transition effect presents the new view controller using an existing view controller. navigation controller A container view controller used to present hierarchical content. navigation interface The style of interface that is presented by a navigation controller’s view. A navigation interface includes a navigation bar along the top of the screen to facilitate navigating between different screens. navigation stack The list of view controllers currently being managed by a navigation controller. The view controllers on the stack represent the content currently being displayed by a navigation interface. page view controller A container view controller used to display pages of content with an artistic style similar to that of a physical book. popover controller A controller class used to present another view controller’s view in a popover control. popover segue A segue whose transition effect displays the new view controller’s content in a popover control. push segue A segue whose transition effect pushes the new view controller onto a navigation stack of a navigation controller. root view controller The topmost view controller in a view controller hierarchy. scene A visual representation in Interface Builder of a view controller and its associated objects, including the views it loads when displayed. segue A transition between two scenes, configured in Interface Builder. split view controller A container view controller used in iPad appsto present master-detail interfaces. tab bar controller A container view controller used to present a set of distinct interface screens, each represented by a tab and delivered by a separate content view controller. tab bar interface The style of interface that is presented by a tab bar controller’s view. A tab bar interface includes one or more tabs at the bottom of the screen. Tapping a tab changes the currently displayed screen contents. view controller An object that descends from the UIViewController class. View controllers coordinate the interactions between a set of views and the custom data presented by those views. 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 124 Glossaryview controller hierarchy A set of container and content view controllers arranged in a tree. Non-leaf nodes always represent container view controllers. Glossary 2012-09-19 | © 2012 Apple Inc. All Rights Reserved. 125Apple Inc. © 2012 Apple Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrievalsystem, or transmitted, in any form or by any means, mechanical, electronic, photocopying, recording, or otherwise, without prior written permission of Apple Inc., with the following exceptions: Any person is hereby authorized to store documentation on a single computer for personal use only and to print copies of documentation for personal use provided that the documentation contains Apple’s copyright notice. No licenses, express or implied, are granted with respect to any of the technology described in this document. Apple retains all intellectual property rights associated with the technology described in this document. This document is intended to assist application developers to develop applications only for Apple-labeled computers. Apple Inc. 1 Infinite Loop Cupertino, CA 95014 408-996-1010 Apple, the Apple logo, Cocoa, iBook, iBooks, iPad, iPhone, Objective-C, and Xcode are trademarks of Apple Inc., registered in the U.S. and other countries. iOS is a trademark or registered trademark of Cisco in the U.S. and other countries and is used under license. Even though Apple has reviewed this document, APPLE MAKES NO WARRANTY OR REPRESENTATION, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THIS DOCUMENT, ITS QUALITY, ACCURACY, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.ASARESULT, THISDOCUMENT IS PROVIDED “AS IS,” AND YOU, THE READER, ARE ASSUMING THE ENTIRE RISK AS TO ITS QUALITY AND ACCURACY. IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL,OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT OR INACCURACY IN THIS DOCUMENT, even if advised of the possibility of such damages. THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORAL OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer, agent, or employee is authorized to make any modification, extension, or addition to this warranty. Some states do not allow the exclusion or limitation of implied warranties or liability for incidental or consequential damages, so the above limitation or exclusion may not apply to you. This warranty gives you specific legal rights, and you may also have other rights which vary from state to state. Key-Value Observing Programming GuideContents Introduction to Key-Value Observing Programming Guide 4 At a Glance 4 Registering for Key-Value Observing 7 Registering as an Observer 7 Receiving Notification of a Change 8 Removing an Object as an Observer 10 KVO Compliance 11 Automatic Change Notification 11 Manual Change Notification 12 Registering Dependent Keys 15 To-one Relationships 15 To-many Relationships 16 Key-Value Observing Implementation Details 19 Document Revision History 20 2012-07-17 | © 2003, 2012 Apple Inc. All Rights Reserved. 2Listings Registering for Key-Value Observing 7 Listing 1 Registering the inspector as an observer of the openingBalance property 7 Listing 2 Implementation of observeValueForKeyPath:ofObject:change:context: 9 Listing 3 Removing the inspector as an observer of openingBalance 10 KVO Compliance 11 Listing 1 Examples of method calls that cause KVO change notifications to be emitted 11 Listing 2 Example implementation of automaticallyNotifiesObserversForKey: 12 Listing 3 Example accessor method implementing manual notification 13 Listing 4 Testing the value for change before providing notification 13 Listing 5 Nesting change notifications for multiple keys 13 Listing 6 Implementation of manual observer notification in a to-many relationship 14 Registering Dependent Keys 15 Listing 1 Example implementation of keyPathsForValuesAffectingValueForKey: 15 Listing 2 Example implementation of the keyPathsForValuesAffecting naming convention 16 2012-07-17 | © 2003, 2012 Apple Inc. All Rights Reserved. 3Key-value observing is a mechanism that allows objects to be notified of changes to specified properties of other objects. Important: In order to understand key-value observing, you must first understand key-value coding. At a Glance Key-value observing provides a mechanism that allows objects to be notified of changes to specific properties of other objects. It is particularly useful for communication between model and controller layers in an application. (In OS X, the controller layer binding technology relies heavily on key-value observing.) A controller object typically observes properties of model objects, and a view object observes properties of model objects through a controller. In addition, however, a model object may observe other model objects (usually to determine when a dependent value changes) or even itself (again to determine when a dependent value changes). You can observe properties including simple attributes, to-one relationships, and to-many relationships. Observers of to-many relationships are informed of the type of change made—as well as which objects are involved in the change. There are three steps to setting up an observer of a property. Understanding these three steps provides a clear illustration of how KVO works. 1. First, see whether you have a scenario where key-value observing could be beneficial, for example, an object that needs to be notified when any changes are made to a specific property in another object. BankObject @property int accountBalance PersonObject For example, a PersonObject will want to be aware of any changes made to their accountBalance in the BankObject. 2012-07-17 | © 2003, 2012 Apple Inc. All Rights Reserved. 4 Introduction to Key-Value Observing Programming Guide2. The PersonObject must register as an observer of the BankObject’s accountBalance property by sending an addObserver:forKeyPath:options:context: message. BankObject PersonObject Connection established [bankInstance addObserver:personInstance forKeyPath:@"accountBalance" options:NSKeyValueObservingOptionNew context:NULL]; Note: The addObserver:forKeyPath:options:context:method establishes a connection between the instances of the objects that you specify. A connection is not established between the two classes, but rather between the two specified instances of the objects. 3. In order to respond to change notifications, the observer must implement the observeValueForKeyPath:ofObject:change:context: method. This method implementation defines how the observer responds to change notifications. It is in this method that you can customize your response to a change in one of the observed properties. BankObject PersonObject Connection established -(void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { //custom implementation //be sure to call the superclass’ implementation //if the superclass implements it } “Registering for Key-Value Observing” (page 7) describes how to register and receive observation notifications. Introduction to Key-Value Observing Programming Guide At a Glance 2012-07-17 | © 2003, 2012 Apple Inc. All Rights Reserved. 54. The observeValueForKeyPath:ofObject:change:context: method is automatically invoked when the value of an observed property is changed in a KVO-compliant manner, or if a key upon which it depends is changed. BankObject PersonObject Automatically notifies person Person can react accordingly in customized method [bankInstance setAccountBalance:50]; “Registering Dependent Keys” (page 15) explains how to specify that the value of a key is dependent on the value of another key. KVO’s primary benefit is that you don’t have to implement your own scheme to send notifications every time a property changes. Its well-defined infrastructure has framework-level support that makes it easy to adopt—typically you do not have to add any code to your project. In addition, the infrastructure is already full-featured, which makes it easy to support multiple observers for a single property, as well as dependent values. “KVO Compliance” (page 11) describes the difference between automatic and manual key-value observing, and how to implement both. Unlike notifications that use NSNotificationCenter, there is no central object that provides change notification for all observers. Instead, notifications are sent directly to the observing objects when changes are made. NSObject provides this base implementation of key-value observing, and you should rarely need to override these methods. “Key-Value Observing Implementation Details ” (page 19) describes how key-value observing is implemented. Introduction to Key-Value Observing Programming Guide At a Glance 2012-07-17 | © 2003, 2012 Apple Inc. All Rights Reserved. 6In order to receive key-value observing notifications for a property, three things are required: ● The observed class must be key-value observing compliant for the property that you wish to observe. ● You must register the observing object with the observed object, using the method addObserver:forKeyPath:options:context:. ● The observing class must implement observeValueForKeyPath:ofObject:change:context:. Important: Not all classes are KVO-compliant for all properties. You can ensure your own classes are KVO-compliant by following the steps described in “KVO Compliance” (page 11). Typically properties in Apple-supplied frameworks are only KVO-compliant if they are documented as such. Registering as an Observer In order to be notified of changes to a property, an observing object must first register with the object to be observed by sending it an addObserver:forKeyPath:options:context: message, passing the observer object and the key path of the property to be observed. The options parameter specifies the information that is provided to the observer when a change notification is sent. Using the option NSKeyValueObservingOptionOld specifies that the original object value is provided to the observer as an entry in the change dictionary. Specifying the NSKeyValueObservingOptionNew option provides the new value as an entry in the change dictionary. To receive both values, you would bitwise OR the option constants. The example in Listing 1 demonstrates registering an inspector object for the property openingBalance. Listing 1 Registering the inspector as an observer of the openingBalance property - (void)registerAsObserver { /* Register 'inspector' to receive change notifications for the "openingBalance" property of the 'account' object and specify that both the old and new values of "openingBalance" should be provided in the observe… method. 2012-07-17 | © 2003, 2012 Apple Inc. All Rights Reserved. 7 Registering for Key-Value Observing*/ [account addObserver:inspector forKeyPath:@"openingBalance" options:(NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld) context:NULL]; } When you register an object as an observer, you can also provide a context pointer. The context pointer is provided to the observer when observeValueForKeyPath:ofObject:change:context: is invoked. The context pointer can be a C pointer or an object reference. The context pointer can be used as a unique identifier to determine the change that is being observed, or to provide some other data to the observer. Note: The key-value observing addObserver:forKeyPath:options:context: method does not maintain strong references to the observing object, the observed objects, or the context. You should ensure that you maintain strong references to the observing, and observed, objects, and the context as necessary. Receiving Notification of a Change When the value of an observed property of an object changes, the observer receives an observeValueForKeyPath:ofObject:change:context: message. All observers must implement this method. The observer is provided the object and key path that triggered the observer notification, a dictionary containing details about the change, and the context pointer that was provided when the observer was registered. The change dictionary entry NSKeyValueChangeKindKey provides information about the type of change that occurred. If the value of the observed object has changed, the NSKeyValueChangeKindKey entry returns NSKeyValueChangeSetting. Depending on the options specified when the observer was registered, the NSKeyValueChangeOldKey and NSKeyValueChangeNewKey entries in the change dictionary contain the values of the property before, and after, the change. If the property is an object, the value is provided directly. If the property is a scalar or a C structure, the value is wrapped in an NSValue object (as with key-value coding). Registering for Key-Value Observing Receiving Notification of a Change 2012-07-17 | © 2003, 2012 Apple Inc. All Rights Reserved. 8If the observed property is a to-many relationship, the NSKeyValueChangeKindKey entry also indicates whether objects in the relationship were inserted, removed, or replaced by returning NSKeyValueChangeInsertion, NSKeyValueChangeRemoval, or NSKeyValueChangeReplacement, respectively. The change dictionary entry for NSKeyValueChangeIndexesKey is an NSIndexSet object specifying the indexes in the relationship that changed. If NSKeyValueObservingOptionNew or NSKeyValueObservingOptionOld are specified as options when the observer is registered, the NSKeyValueChangeOldKey and NSKeyValueChangeNewKey entries in the change dictionary are arrays containing the values of the related objects before, and after, the change. The example in Listing 2 shows the observeValueForKeyPath:ofObject:change:context: implementation for an inspector that reflects the old and new values of the property openingBalance, as registered in Listing 1 (page 7). Listing 2 Implementation of observeValueForKeyPath:ofObject:change:context: - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if ([keyPath isEqual:@"openingBalance"]) { [openingBalanceInspectorField setObjectValue: [change objectForKey:NSKeyValueChangeNewKey]]; } /* Be sure to call the superclass's implementation *if it implements it*. NSObject does not implement the method. */ [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; } Registering for Key-Value Observing Receiving Notification of a Change 2012-07-17 | © 2003, 2012 Apple Inc. All Rights Reserved. 9Removing an Object as an Observer You remove a key-value observer by sending the observed object a removeObserver:forKeyPath: message, specifying the observing object and the key path. The example in Listing 3 removesthe inspector as an observer of openingBalance. Listing 3 Removing the inspector as an observer of openingBalance - (void)unregisterForChangeNotification { [observedObject removeObserver:inspector forKeyPath:@"openingBalance"]; } If the context is an object, you must keep a strong reference to it until removing the observer. After receiving a removeObserver:forKeyPath: message, the observing object will no longer receive any observeValueForKeyPath:ofObject:change:context: messagesfor the specified key path and object. Registering for Key-Value Observing Removing an Object as an Observer 2012-07-17 | © 2003, 2012 Apple Inc. All Rights Reserved. 10In order to be considered KVO-compliant for a specific property, a class must ensure the following: ● The class must be key-value coding compliant for the property, as specified in “Ensuring KVC Compliance”. KVO supports the same data types as KVC. ● The class emits KVO change notifications for the property. ● Dependent keys are registered appropriately (see “Registering Dependent Keys” (page 15)). There are two techniques for ensuring the change notifications are emitted. Automatic support is provided by NSObject and is by default available for all properties of a class that are key-value coding compliant. Typically, if you follow standard Cocoa coding and naming conventions, you can use automatic change notifications—you don’t have to write any additional code. Manual change notification provides additional control over when notifications are emitted, and requires additional coding. You can control automatic notifications for properties of your subclass by implementing the class method automaticallyNotifiesObserversForKey:. Automatic Change Notification NSObject provides a basic implementation of automatic key-value change notification. Automatic key-value change notification informs observers of changes made using key-value compliant accessors, as well as the key-value coding methods. Automatic notification is also supported by the collection proxy objects returned by, for example, mutableArrayValueForKey:. The examples shown in Listing 1 result in any observers of the property name to be notified of the change. Listing 1 Examples of method calls that cause KVO change notifications to be emitted // Call the accessor method. [account setName:@"Savings"]; // Use setValue:forKey:. [account setValue:@"Savings" forKey:@"name"]; 2012-07-17 | © 2003, 2012 Apple Inc. All Rights Reserved. 11 KVO Compliance// Use a key path, where 'account' is a kvc-compliant property of 'document'. [document setValue:@"Savings" forKeyPath:@"account.name"]; // Use mutableArrayValueForKey: to retrieve a relationship proxy object. Transaction *newTransaction = <#Create a new transaction for the account#>; NSMutableArray *transactions = [account mutableArrayValueForKey:@"transactions"]; [transactions addObject:newTransaction]; Manual Change Notification Manual change notification provides more granular control over how and when notifications are sent to observers. This can be useful to help minimize triggering notifications that are unnecessary, or to group a number of changes into a single notification. A class that implements manual notification must override the NSObject implementation of automaticallyNotifiesObserversForKey:. It is possible to use both automatic and manual observer notifications in the same class. For properties that perform manual notification, the subclass implementation of automaticallyNotifiesObserversForKey: should return NO. A subclassimplementation should invoke super for any unrecognized keys. The example in Listing 2 enables manual notification for the openingBalance property allowing the superclass to determine the notification for all other keys. Listing 2 Example implementation of automaticallyNotifiesObserversForKey: + (BOOL)automaticallyNotifiesObserversForKey:(NSString *)theKey { BOOL automatic = NO; if ([theKey isEqualToString:@"openingBalance"]) { automatic = NO; } else { automatic = [super automaticallyNotifiesObserversForKey:theKey]; } return automatic; } KVO Compliance Manual Change Notification 2012-07-17 | © 2003, 2012 Apple Inc. All Rights Reserved. 12To implement manual observer notification, you invoke willChangeValueForKey: before changing the value, and didChangeValueForKey: after changing the value. The example in Listing 3 implements manual notifications for the openingBalance property. Listing 3 Example accessor method implementing manual notification - (void)setOpeningBalance:(double)theBalance { [self willChangeValueForKey:@"openingBalance"]; _openingBalance = theBalance; [self didChangeValueForKey:@"openingBalance"]; } You can minimize sending unnecessary notifications by first checking if the value has changed. The example in Listing 4 tests the value of openingBalance and only provides the notification if it has changed. Listing 4 Testing the value for change before providing notification - (void)setOpeningBalance:(double)theBalance { if (theBalance != _openingBalance) { [self willChangeValueForKey:@"openingBalance"]; _openingBalance = theBalance; [self didChangeValueForKey:@"openingBalance"]; } } If a single operation causes multiple keysto change you must nest the change notifications asshown in Listing 5. Listing 5 Nesting change notifications for multiple keys - (void)setOpeningBalance:(double)theBalance { [self willChangeValueForKey:@"openingBalance"]; [self willChangeValueForKey:@"itemChanged"]; _openingBalance = theBalance; _itemChanged = _itemChanged+1; [self didChangeValueForKey:@"itemChanged"]; [self didChangeValueForKey:@"openingBalance"]; } KVO Compliance Manual Change Notification 2012-07-17 | © 2003, 2012 Apple Inc. All Rights Reserved. 13In the case of an ordered to-many relationship, you must specify not only the key that changed, but also the type of change and the indexes of the objects involved. The type of change is an NSKeyValueChange that specifies NSKeyValueChangeInsertion, NSKeyValueChangeRemoval, or NSKeyValueChangeReplacement. The indexes of the affected objects are passed as an NSIndexSet object. The code fragment in Listing 6 demonstrates how to wrap a deletion of objects in the to-many relationship transactions. Listing 6 Implementation of manual observer notification in a to-many relationship - (void)removeTransactionsAtIndexes:(NSIndexSet *)indexes { [self willChange:NSKeyValueChangeRemoval valuesAtIndexes:indexes forKey:@"transactions"]; // Remove the transaction objects at the specified indexes. [self didChange:NSKeyValueChangeRemoval valuesAtIndexes:indexes forKey:@"transactions"]; } KVO Compliance Manual Change Notification 2012-07-17 | © 2003, 2012 Apple Inc. All Rights Reserved. 14There are many situations in which the value of one property depends on that of one or more other attributes in another object. If the value of one attribute changes, then the value of the derived property should also be flagged for change. How you ensure that key-value observing notifications are posted for these dependent properties depends on the cardinality of the relationship. To-one Relationships To trigger notifications automatically for a to-on relationship you should either override keyPathsForValuesAffectingValueForKey: or implement a suitable method that follows the pattern it defines for registering dependent keys. For example, the full name of a person is dependent on both the first and last names. A method that returns the full name could be written as follows: - (NSString *)fullName { return [NSString stringWithFormat:@"%@ %@",firstName, lastName]; } An application observing the fullName property must be notified when either the firstName or lastName properties change, as they affect the value of the property. One solution is to override keyPathsForValuesAffectingValueForKey: specifying that the fullName property of a person is dependent on the lastName and firstName properties. Listing 1 (page 15) shows an example implementation of such a dependency: Listing 1 Example implementation of keyPathsForValuesAffectingValueForKey: + (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key { NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key]; if ([key isEqualToString:@"fullName"]) { 2012-07-17 | © 2003, 2012 Apple Inc. All Rights Reserved. 15 Registering Dependent KeysNSArray *affectingKeys = @[@"lastName", @"firstName"]; keyPaths = [keyPaths setByAddingObjectsFromArray:affectingKeys]; } return keyPaths; } Your override should typically invoke super and return a set that includes any members in the set that result from doing that (so as not to interfere with overrides of this method in superclasses). You can also achieve the same result by implementing a class method that follows the naming convention keyPathsForValuesAffecting, where is the name of the attribute (first letter capitalized) that is dependent on the values. Using this pattern the code in Listing 1 (page 15) could be rewritten as a class method named keyPathsForValuesAffectingFullName as shown in Listing 2 (page 16). Listing 2 Example implementation of the keyPathsForValuesAffecting naming convention + (NSSet *)keyPathsForValuesAffectingFullName { return [NSSet setWithObjects:@"lastName", @"firstName", nil]; } You can't override the keyPathsForValuesAffectingValueForKey: method when you add a computed property to an existing class using a category, because you're not supposed to override methods in categories. In that case, implement a matching keyPathsForValuesAffecting class method to take advantage of this mechanism. Note: You cannot set up dependencies on to-many relationships by implementing keyPathsForValuesAffectingValueForKey:. Instead, you must observe the appropriate attribute of each of the objects in the to-many collection and respond to changes in their values by updating the dependent key yourself. The following section shows a strategy for dealing with this situation. To-many Relationships The keyPathsForValuesAffectingValueForKey: method does not support key-paths that include a to-many relationship. For example, suppose you have a Department object with a to-many relationship (employees) to a Employee, and Employee has a salary attribute. You might want the Department object have Registering Dependent Keys To-many Relationships 2012-07-17 | © 2003, 2012 Apple Inc. All Rights Reserved. 16a totalSalary attribute that is dependent upon the salaries of all the Employees in the relationship. You can not do this with, for example, keyPathsForValuesAffectingTotalSalary and returning employees.salary as a key. There are two possible solutions in both situations: 1. You can use key-value observing to register the parent (in this example, Department) as an observer of the relevant attribute of all the children (Employeesin this example). You must add and remove the parent as an observer as child objects are added to and removed from the relationship (see “Registering for Key-Value Observing” (page 7)). In the observeValueForKeyPath:ofObject:change:context: method you update the dependent value in response to changes, as illustrated in the following code fragment: - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if (context == totalSalaryContext) { [self updateTotalSalary]; } else // deal with other observations and/or invoke super... } - (void)updateTotalSalary { [self setTotalSalary:[self valueForKeyPath:@"employees.@sum.salary"]]; } - (void)setTotalSalary:(NSNumber *)newTotalSalary { if (totalSalary != newTotalSalary) { [self willChangeValueForKey:@"totalSalary"]; _totalSalary = newTotalSalary; [self didChangeValueForKey:@"totalSalary"]; } } - (NSNumber *)totalSalary { return _totalSalary; Registering Dependent Keys To-many Relationships 2012-07-17 | © 2003, 2012 Apple Inc. All Rights Reserved. 17} 2. If you're using Core Data, you can register the parent with the application's notification center as an observer of its managed object context. The parentshould respond to relevant change notifications posted by the children in a manner similar to that for key-value observing. Registering Dependent Keys To-many Relationships 2012-07-17 | © 2003, 2012 Apple Inc. All Rights Reserved. 18Automatic key-value observing is implemented using a technique called isa-swizzling. The isa pointer, as the name suggests, points to the object's class which maintains a dispatch table. This dispatch table essentially contains pointers to the methods the class implements, among other data. When an observer is registered for an attribute of an object the isa pointer of the observed object is modified, pointing to an intermediate class rather than at the true class. As a result the value of the isa pointer does not necessarily reflect the actual class of the instance. You should never rely on the isa pointer to determine class membership. Instead, you should use the class method to determine the class of an object instance. 2012-07-17 | © 2003, 2012 Apple Inc. All Rights Reserved. 19 Key-Value Observing Implementation DetailsThis table describes the changes to Key-Value Observing Programming Guide . Date Notes 2012-07-17 Updated to use new Objective-C features. ARCification 2011-03-08 Clarified terminology in "Registering Dependent Keys." 2009-08-14 Added links to some key Cocoa definitions. 2009-05-09 Corrected minor typo. 2009-05-06 Clarified Core Data requirement in Registering Dependent Keys. 2009-03-04 Updated Registering Dependent Keys chapter. 2006-06-28 Updated code examples. Clarified that you should not release objects before calling willChangeValueForKey: methods. Noted that Java is not supported. 2005-07-07 2004-08-31 Corrected minor typos. Clarified the need to nest manual key-value change notifications. 2004-03-20 Modified source example in “Registering Dependent Keys” (page 15). Corrected source example in “Registering for Key-Value Observing” (page 7). Added article “Key-Value Observing Implementation Details ” (page 19). 2004-02-22 2003-10-15 Initial publication of Key-Value Observing. 2012-07-17 | © 2003, 2012 Apple Inc. All Rights Reserved. 20 Document Revision HistoryApple Inc. © 2003, 2012 Apple Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrievalsystem, or transmitted, in any form or by any means, mechanical, electronic, photocopying, recording, or otherwise, without prior written permission of Apple Inc., with the following exceptions: Any person is hereby authorized to store documentation on a single computer for personal use only and to print copies of documentation for personal use provided that the documentation contains Apple’s copyright notice. No licenses, express or implied, are granted with respect to any of the technology described in this document. Apple retains all intellectual property rights associated with the technology described in this document. This document is intended to assist application developers to develop applications only for Apple-labeled computers. Apple Inc. 1 Infinite Loop Cupertino, CA 95014 408-996-1010 Apple, the Apple logo, Cocoa, Mac, and Objective-C are trademarks of Apple Inc., registered in the U.S. and other countries. Java is a registered trademark of Oracle and/or its affiliates. Even though Apple has reviewed this document, APPLE MAKES NO WARRANTY OR REPRESENTATION, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THIS DOCUMENT, ITS QUALITY, ACCURACY, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.ASARESULT, THISDOCUMENT IS PROVIDED “AS IS,” AND YOU, THE READER, ARE ASSUMING THE ENTIRE RISK AS TO ITS QUALITY AND ACCURACY. IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL,OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT OR INACCURACY IN THIS DOCUMENT, even if advised of the possibility of such damages. THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORAL OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer, agent, or employee is authorized to make any modification, extension, or addition to this warranty. Some states do not allow the exclusion or limitation of implied warranties or liability for incidental or consequential damages, so the above limitation or exclusion may not apply to you. This warranty gives you specific legal rights, and you may also have other rights which vary from state to state. Let’s get started When you start your Mac mini for the first time, Setup Assistant helps you get going. Just follow a few simple steps to quickly connect to your Wi-Fi network, transfer your stuff from another Mac or a PC, and create a user account for your Mac. You’ll also be able to log in with your Apple ID. This allows you to shop the App Store, iTunes Store, and Apple Online Store. It lets you keep in touch using Messages and FaceTime. And it lets you access iCloud, which is automatically set up on your Mac in apps like Mail, Contacts, and Calendar. If you don’t have an Apple ID, you can create one in Setup Assistant. Get to know your desktop The desktop is where you can find everything and do anything on your Mac. The Dock at the bottom is a handy place to keep the apps you use most. It’s also where you can open System Preferences, which lets you customize your desktop and other settings on your Mac. Click the Finder icon to quickly get to all your files and folders. The menu bar at the top has lots of useful information about your Mac. To check the status of your wireless Internet connection, click the Wi-Fi icon. Your Mac automatically connects to the network you chose during setup. Hello. iCloud iCloud stores your music, photos, documents, calendars, and more. And it wirelessly pushes them to your Mac, iPhone, iPad, iPod touch, and even your PC. All without docking or syncing. So when you buy a song on one device, it’s instantly available on all your other devices. When you adjust your calendar, all your devices stay up to date. And with Photo Stream, your latest photos appear everywhere you want to see them, automatically. To customize your iCloud settings, open the Apple menu, choose System Preferences, and click iCloud. Then sign in with your Apple ID and choose the iCloud features you want to use. Quick Start Guide Let’s get moving It’s easy to move files like documents, email, photos, music, and movies to your new Mac from another Mac or a PC. The first time you start your new Mac, it walks you through the process step by step. All you have to do is follow the onscreen instructions. If your Mac mini shipped with OS X Server, the Server application will open and walk you through the configuration process. Help menu Menu Dock bar Bluetooth status Finder System Preferences Launchpad Launchpad is the home for all the apps on your Mac. Just click the Launchpad icon in the Dock, and your open windows are replaced by a full-screen display of all your apps. Arrange apps any way you want, group them together in folders, or delete them from your Mac. When you download an app from the Mac App Store, it automatically appears in Launchpad. Mission Control Mission Control gives you a bird’s-eye view of everything running on your Mac. Click the Mission Control icon in the Dock, and your desktop zooms out to display all the open windows in every application, all your fullscreen apps, and Dashboard, the home of mini-apps called widgets. Click anything to zoom in on it. Think of Mission Control as the hub of your system—view everything and go anywhere with just a click. Welcome to your new Mac mini. We’d like to show you around. Removable panel USB 3 Built-in power supply HDMI Thunderbolt Audio in/out Gigabit Ethernet Power button FireWire 800 SD card slot AC power cord HDMI to DVI adapter Open Mission Control Click the Mission Control icon in the Dock. Add desktop spaces Click the + button to the right of the top row to add a new space. Dashboard Located at the top left for easy access. Wi-Fi status Open Launchpad Click the Launchpad icon in the Dock. Folders Group apps in folders by dragging one app on top of another.An important note Please read this document and the safety information in the Important Product Information Guide carefully before you first use your computer. Learn more You can find more information, watch demos, and learn even more about Mac mini features at www.apple.com/macmini. Help You can often find answers to your questions, as well as instructions and troubleshooting information, in Help Center. Click the Finder icon, click Help in the menu bar, and choose Help Center. OS X Utilities If you have a problem with your Mac, OS X Utilities can help you repair your computer’s hard drive, restore your software and data from a Time Machine backup, or erase your hard drive and reinstall OS X and Apple applications. You can also use Safari to get online help. If your Mac detects a problem, it opens OS X Utilities automatically. Or you can open it manually by restarting your computer while holding down the Command and R keys. Support Your Mac mini comes with 90 days of technical support and one year of hardware repair warranty coverage at an Apple Retail Store or an Apple Authorized Service Provider. Visit www.apple.com/support/macmini for Mac mini technical support. Or call 1-800-275-2273. In Canada, call 1-800-263-3394. Not all features are available in all areas. TM and © 2012 Apple Inc. All rights reserved. Designed by Apple in California. Printed in XXXX. 034-6575-A iTunes With iTunes, you can organize and play your digital music and videos on your Mac. And you can shop the iTunes Store for new music, movies, TV shows, books, and more. iTunes is also where you’ll find the App Store for iPad, iPhone, and iPod touch. Click the Safari icon in the Dock and surf the web quickly and easily with Multi-Touch gestures. Scroll up or down with one finger on Magic Mouse. Swipe right and left with two Safari web browser fingers to go back and forth between pages. Hold down the Control key and scroll with one finger to zoom in and out. Mail Mail lets you manage all your email accounts from a single, ad-free inbox, even when you’re not connected to the Internet. It works with most email standards— including POP3 and IMAP—and popular email services like Gmail, Yahoo! Mail, and AOL Mail. You can also use Mail with the free me.com email account you get with iCloud. The first time you open Mail, Setup Assistant will help you get started. Calendar Keep track of your busy schedule with Calendar. You can create separate calendars—one for home, another for school, a third for work. See all your calendars in a single window or choose to see only the calendars you want. Create and send invitations using contact info from the Contacts app, then see who has responded. Use iCloud to update calendars on all your devices automatically or share calendars with other iCloud users. Messages Just log in with your Apple ID, and you can send unlimited messages including text, photos, videos, and more to your friends on a Mac, iPad, iPhone, or iPod touch. With iCloud, you can start a conversation on one device and pick it up on another. And if you want to talk to someone face to face, you can start a video call* just by clicking the FaceTime icon in the top-right corner of the Messages window. iPhoto iPhoto is the best way to organize, browse, edit, and share your photos on your Mac. You can organize your photo library by Faces, Places, and Events. To send photos by email or publish them to Facebook, just select the photo and click Share in the bottom right of your screen. Or click Create to turn your favorite shots into photo books, calendars, and cards. iMovie iMovie puts all your video clips in one place and gives you the editing tools and special effects you need to quickly turn them into something memorable. You can make great-looking movies or even Hollywood-style movie trailers with just a few clicks. And iMovie lets you import video from most popular digital video cameras or your iPhone, iPad, or iPod touch. Mac App Store The Mac App Store is the best way to find and download thousands of apps for your Mac, from games and social networking to productivity apps and more. New apps install in one step to Launchpad. You can install apps on every Mac authorized for your personal use and even download them again. The Mac App Store lets you know when app and OS X updates are available, so you always have the latest versions. Open the Mac App Store by clicking its icon in the Dock. Top Sites Get a quick overview of the sites you visit most often. Reading List Click the glasses icon to save pages to read later. Full-screen view Click the full-screen button to go full screen. One-stop email View all your accounts in Mail for one-click access. Conversation view See all the email messages from a conversation thread. Search Quickly narrow search results to find exactly what you want. iTunes Store Discover and buy new music, movies, and more. Genius Mixes Let iTunes search your music library and group songs that go great together. Multiple calendars Access all your calendars from one place. Calendar view Select the view you prefer—day, week, month, or year. Add an event Double-click in a calendar to create a new event. Replies in progress Three dots mean your friend is typing a reply. Delivery receipts See when your message has arrived. FaceTime Start a video call right in Messages. *Requires FaceTime-enabled device for both caller and recipient. Not available in all areas. Create Create books, cards, and calendars. Faces iPhoto can even organize your photos based on who’s in them. Events Double-click any Event to browse photos. Event browser Your imported videos appear here so you can access all your clips. Project browser Simply drop your clips in a project to create a great movie. Always up to date Updates to your purchased apps and OS X appear automatically. Discover new apps Browse thousands of apps and download them straight to Launchpad. OS X Mountain Lion Core Technologies Overview June 20122 Core Technologies Overview OS X Mountain Lion Contents Page 3 Introduction Page 4 System Startup BootROM EFI Kernel Drivers Initialization Address Space Layout Randomization (ASLR) Page 7 Disk Layout Partition scheme Core Storage File systems Page 9 Process Control Launchd Loginwindow Grand Central Dispatch Sandboxing GateKeeper XPC Page 16 Network Access Ethernet Wi-Fi Multihoming IPv6 Remote Access Bonjour Page 21 Document Lifecycle Auto Save Automatic Versions Version Management iCloud Storage Page 24 Data Management Spotlight Time Machine Page 26 Developer Tools LLVM Xcode Instruments Accelerate Automation WebKit Page 33 For More Information3 Core Technologies Overview OS X Mountain Lion Introduction With more than 65 million users—consumers, scientists, animators, developers, system administrators, and more—OS X is the most widely used UNIX® desktop operating system. In addition, OS X is the only UNIX environment that natively runs Microsoft Office, Adobe Photoshop, and thousands of other consumer applications—all side by side with traditional command-line UNIX applications. Tight integration with hardware—from the sleek MacBook Air to the powerful Mac Pro—makes OS X the platform of choice for an emerging generation of power users. This document explores the powerful industry standards and breakthrough innovations in the core technologies that power Apple’s industry-leading user experiences. We walk you through the entire software stack, from firmware and kernel to iCloud and developer tools, to help you understand the many things OS X does for you every time you use your Mac. 4 Core Technologies Overview OS X Mountain Lion BootROM When you turn on the power to a Mac, it activates the BootROM firmware. BootROM, which is part of the computer’s hardware, has two primary responsibilities: it initializes system hardware and it selects an operating system to run. Two BootROM components carry out these functions: • Power-On Self Test (POST) initializes some hardware interfaces and verifies that sufficient memory is available and in a good state. • Extensible Firmware Interface (EFI) does basic hardware initialization and selects which operating system to use. If multiple OS installations are available, BootROM chooses the one that was last selected by the Startup Disk System Preference. The user can override this choice by holding down the Option key while the computer starts up, which causes EFI to display a screen for choosing the startup volume. EFI boot picker screen. System Startup5 Core Technologies Overview OS X Mountain Lion EFI EFI—a standard created by Intel—defines the interface between an operating system and platform firmware. It supersedes the legacy Basic Input Output System (BIOS) and OpenFirmware architectures. Once BootROM is finished and an OS X partition has been selected, control passes to the boot.efi boot loader, which runs inside EFI. The principal job of this boot loader is to load the kernel environment. As it does this, the boot loader draws the “booting” image on the screen. If full-disk encryption is enabled, the boot loader draws the login UI and prompts for the user’s password, which the system needs so it can access the encrypted disk and boot from it. Otherwise, loginwindow draws the login UI. Kernel The OS X kernel is based on FreeBSD and Mach 3.0 and features an extensible architecture based on well-defined kernel programming interfaces (KPIs). OS X was the first operating system to ship as a single install that could boot into either a 32-bit or 64-bit kernel, either of which could run 32-bit and 64-bit applications at full native performance. Starting with Mountain Lion, OS X exclusively uses a 64-bit kernel, but it continues to run both 32-bit and 64-bit applications. Drivers Drivers in OS X are provided by I/O Kit, a collection of system frameworks, libraries, tools, and other resources for creating device drivers. I/O Kit is based on an objectoriented programming model implemented in a restricted form of C++ that omits features unsuitable for use within a multithreaded kernel. By modeling the hardware connected to an OS X system and abstracting common functionality for devices in particular categories, the I/O Kit streamlines the process of device-driver development. I/O Kit helps device manufacturers rapidly create drivers that run safely in a multiprocessing, preemptive, hot-pluggable, power-managed environment. To do this, I/O Kit provides the following: • An object-oriented framework implementing common behavior shared among all drivers and types (families) of drivers • Many families of drivers for developers to build upon • Threading, communication, and data-management primitives for dealing with issues related to multiprocessing, task control, and I/O-transfers • A robust, efficient match-and-load mechanism that scales well to all bus types • The I/O Registry, a database that tracks instantiated objects (such as driver instances) and provides information about them • The I/O Catalog, a database of all I/O Kit classes available on a system • A set of device interfaces—plug-in mechanism that allows applications and other software outside the kernel to communicate with drivers • Excellent overall performance • Support for arbitrarily complex layering of client and provider objects6 Core Technologies Overview OS X Mountain Lion Initialization There are two phases to system initialization: • boot refers to loading the bootstrap loader and kernel • root means mounting a partition as the root, or top-level, file system. Once the kernel and all drivers necessary for booting are loaded, the boot loader starts the kernel’s initialization procedure. At this point, enough drivers are loaded for the kernel to find the root device—the disk or network service where the rest of the operating system resides. The kernel initializes the Mach and BSD data structures and then initializes the I/O Kit. The I/O Kit links the loaded drivers into the kernel, using the device tree to determine which drivers to link. Once the kernel finds the root device, it roots BSD off of it. Address Space Layout Randomization (ASLR) Many malware exploits rely on fixed locations for well-known system functions. To mitigate that risk, Mountain Lion randomly relocates the kernel, kexts, and system frameworks at system boot. This protection is available to both 32-bit and 64-bit processes. 7 Core Technologies Overview OS X Mountain Lion Partition scheme Disk drives are divided into logical partitions, which Apple traditionally calls volumes. Modern Mac systems use the GUID partition table (GPT) partitioning scheme introduced by Intel as part of EFI. The partitioning scheme is formally defined by: • Section 11.2.2 of “Extensible Firmware Interface Specification,” version 1.1, available from Intel • Chapter 5, “GUID Partition Table (GPT) Format,” of the “Unified Extensible Firmware Interface Specification,” version 2.0, available from the Unified EFI Forum Any Mac running OS X 10.4 or later can mount GPT-partitioned disks. Intel-based Mac systems can boot from GPT. By default, the internal hard disk is formatted as GPT. You can explore and modify GPT disks using the gpt command-line tool derived from FreeBSD. You can also use Apple’s GPT-aware diskutil utility which provides more human-readable output. Helper partitions Typically a single partition is “blessed” as the active boot volume via the bless command-line tool, though you can also bless specific folders or files. This partition is usually also the root volume. However, sometimes the boot partition is not the root, such as when the root partition is encrypted using full-disk encryption or located on a device that requires additional drivers (such as a RAID array). In that case, a hidden helper partition stores the files needed to boot, such as the kernel cache. The last three known good helper partitions are maintained in case one becomes corrupted. Recovery partitions OS X Lion introduced a new Recovery HD partition that includes the tools you need to do the following: • Reinstall OS X • Repair a hard drive • Restore from a Time Machine backup • Launch Safari to view documentation and search the Internet • Create Recovery HD partitions on external drives. To boot from the Recovery HD partition, restart your Mac while holding down the Command key and the R key (Command-R). Keep holding them until the Apple icon appears, indicating that your Mac is starting up. After the Recovery HD finishes starting up, you should see a desktop with an OS X menu bar and an OS X Utilities application window. Disk Layout8 Core Technologies Overview OS X Mountain Lion If your Recovery HD is corrupt or unavailable and you have a network connection, your Mac will automatically use OS X Internet Recovery to download and boot directly from Apple’s servers, using a pristine Recovery HD image that provides all the same functionality. Core Storage Layered between the whole-disk partition scheme and the file system used for a specific partition is a new logical volume format known as Core Storage, introduced in OS X Lion. Core Storage makes it easy to dynamically allocate partitions while providing full compatibility with existing filesystems. In particular, Core Storage allows in-place transformations such as backgrounding the full-disk encryption used by File Vault 2. File systems Partitions are typically formatted using some variant of the HFS Plus file system, which provides fast Btree-based lookups, robust aliases, and rich metadata—including fine-grained access controls and extended attributes. Since OS X 10.3 Panther, every Mac has used a journaled version of HFS Plus (HFSJ) to improve data reliability. Since OS X 10.6 Snow Leopard, HFS Plus has automatically compressed files. You can also choose to format partitions with HFSX, a case-sensitive variant of HFS Plus intended for compatibility with UNIX software. For interoperability with Windows, systems disks may be formatted with FAT32 or exFAT.9 Core Technologies Overview OS X Mountain Lion Launchd The kernel invokes launchd as the first process to run and then bootstraps the rest of the system. It replaces the complex web of init, cron, xinetd, and /etc/rc used to launch and manage processes on traditional UNIX systems. launchd first appeared in OS X 10.4 Tiger. It is available as open source under the Apache license. File-based configuration Each job managed by launchd has its own configuration file in a standard launchd.plist(5) file format, which specifies the working directory, environment variables, timeout, Bonjour registration, etc. These plists can be installed independently in the standard OS X library domains (for example, /Network/Library, /System/Library, / Library, or ~/Library), avoiding the need to edit system-wide configuration scripts. Jobs and plists can also be manually managed by the launctl(1) command-line tool. Launch on demand launchd prefers for processes to run only when needed instead of blocking or polling continuously in the background. These launch-on-demand semantics avoid wasting CPU and memory resources, and thus prolong battery life. For example, jobs can be started based on the following: • If the network goes up or down • When a file path exists (e.g., for a printer queue) • When a device or file system is mounted Smart scheduling Like traditional UNIX cron jobs, launchd jobs can be scheduled for specific calendar dates with the StartCalendarInterval key, as well as at generic intervals via the StartInterval key. Unlike cron—which skips job invocations when the computer is asleep—launchd starts the job the next time the computer wakes up. If the computer sleeps through multiple intervals, those events will be coalesced into a single trigger. User agents launchd defines a daemon as a system-wide service where one instance serves multiple clients. Conversely, an agent runs once for each user. Daemons should not attempt to display UI or interact directly with a user’s login session; any and all work that involves interacting with a user should be done through agents. Process Control10 Core Technologies Overview OS X Mountain Lion Every launchd agent is associated with a Session Type, which determines where it runs and what it can do, as shown in the following table: Name Session type Notes GUI Aqua Has access to all GUI services; much like a login item Non-GUI StandardIO Runs only in non-GUI login sessions (for example, SSH login sessions) Per-user Background Runs in a context that’s the parent of all contexts for a given user Pre-login LoginWindow Runs in the loginwindow context Install on demand To reduce download sizes and the surface area available to attackers, OS X provides an install-on-demand mechanism for certain subsystems. This provides easy access for those users who need them without burdening those who don’t. When you launch an application that relies on X11 or Java, OS X asks whether you want to download the latest version as shown in the next image. OS X prompts users if they attempt to run applications that require X11. Loginwindow As the final part of system initialization, launchd launches loginwindow. The loginwindow program controls several aspects of user sessions and coordinates the display of the login window and the authentication of users. If a password is set, OS X requires users to authenticate before they can access the system. The loginwindow program manages both the visual portion of the login process (as manifested by the window where users enter name and password information) and the security portion (which handles user authentication). Once a user has been authenticated, loginwindow begins setting up the user environment. As part of this process, it performs the following tasks: • Secures the login session from unauthorized remote access • Records the login in the system’s utmp and utmpx databases • Sets the owner and permissions for the console terminal • Resets the user’s preferences to include global system defaults • Configures the mouse, keyboard, and system sound according to user preferences • Sets the user’s group permissions (gid)11 Core Technologies Overview OS X Mountain Lion • Retrieves the user record from Directory Services and applies that information to the session • Loads the user’s computing environment (including preferences, environment variables, device and file permissions, keychain access, and so on) • Launches the Dock, Finder, and SystemUIServer • Launches the login items for the user Once the user session is up and running, loginwindow monitors the session and user applications in the following ways: • Manages the logout, restart, and shutdown procedures • Manages Force Quit by monitoring the currently active applications and responding to user requests to force quit applications and relaunch the Finder. (Users open this window from the Apple menu or by pressing Command-Option-Escape.) • Arranges for any output written to the standard error console to be logged using the Apple System Loger (ASL) API. (See “Log Messages Using the ASL API” in the OS X Developer Library.) Grand Central Dispatch Grand Central Dispatch (GCD) supports concurrent computing via an easy-to-use programming model built on highly efficient system services. This radically simplifies the code needed for parallel and asynchronous processing across multiple cores. GCD is built around three core pieces of functionality: • Blocks, a concise syntax for describing work to be done • Queues, an efficient mechanism for collecting work to be done • Thread pools, an optimal service for distributing work to be done These help your Mac make better use of all available CPU cores while improving responsiveness by preventing the main thread from blocking. System-wide optimization The central insight of GCD is shifting the responsibility for managing threads and their execution from applications to the operating system. As a result, programmers can write less code to deal with concurrent operations in their applications, and the system can perform more efficiently on both single-processor and multiprocessor machines. Without a pervasive approach such as GCD, even the best-written application cannot deliver optimal performance across diverse environments because it lacks insight into everything else happening on the system. Blocks Block objects are extensions to C, Objective-C, and C++ that make it easy for programmers to encapsulate inline code and data for later use. Here’s what a block object looks like: int scale = 4; int (^Multiply)(int) = ^(int num) { return scale * num; }; int result = Multiply(7); // result is 2812 Core Technologies Overview OS X Mountain Lion These types of “closures”—effectively a function pointer plus its invocation context— are common in dynamically-typed interpreted languages, but they were never before widely available to C programmers. Apple has published both the Blocks Language Specification and its implementation as open source under the MIT license and added blocks support to both GCC and Clang/LLVM. Queues GCD dispatch queues are a powerful tool for performing tasks safely and efficiently on multiple CPUs. Dispatch queues atomically add blocks of code that can execute either asynchronously or synchronously. Serial queues enable mutually exclusive access to shared data or other resources without the overhead or fragility of locks. Concurrent queues can execute tasks across multiple distinct threads, based on the number of currently available CPUs. Thread pools The root level of GCD is a set of global concurrent queues for every UNIX process, each of which is associated with a pool of threads. GCD dequeues blocks and private queues from the global queues on a first-in/first-out (FIFO) basis as long as there are available threads in the thread pool, providing an easy way to achieve concurrency. If there is more work than available threads, GCD asks the kernel for more threads, which are given if there are idle logical processors. Conversely, GCD eventually retires threads from the pool if they are unused or the system is under excessive load. This all happens as a side effect of queuing and completing work so that GCD itself doesn’t require a separate thread. This approach provides optimal thread allocation and CPU utilization across a wide range of loads. Event sources In addition to scheduling blocks directly, GCD makes it easy to run a block in response to various system events, such as a timer, signal, I/O, or process state change. When the source fires, GCD will schedule the handler block on the specific queue if it is not currently running, or—more importantly—coalesce pending events if it is running. This provides excellent responsiveness without the expense of either polling or binding a thread to the event source. Plus, since the handler is never run more than once at a time, the block doesn’t even need to be reentrant; only one thread will attempt to read or write any local variables. OpenCL integration Developers traditionally needed to write custom vector code—in addition to their usual scalar code—in order to take full advantage of modern processors. OpenCL is an open standard, language, runtime, and framework introduced in OS X 10.6 Snow Leopard. The OpenCL standard makes it straightforward take advantage of the immense processing power available in GPUs, vector extensions, and multi-core CPUs. You can use OpenCL to move the most time-consuming routines into computational “kernels” written in a simple, C-like language. The OpenCL runtime dynamically compiles these kernels to take advantage of the type and number of processors available on a computer. As of OS X 10.7 Lion, the system takes care of autovectorizing kernels to run efficiently on GPUs or CPUs. OpenCL kernels can also be written as separate files that run as blocks on the GPU or CPU using a special GCD queue.13 Core Technologies Overview OS X Mountain Lion Sandboxing Sandboxes ensure that processes are only allowed to perform a specific set of expected operations. For example, a web browser regularly needs to read from the network, but shouldn’t write to the user’s home folder without explicit permission. Conversely, a disk usage monitor may be allowed to read directories and delete files, but not talk to the network. These restrictions limit the damage a program could potentially cause if it became exploited by an attacker. By using attack mitigation, sandboxes complement the usual security focus on attack prevention. For this reason, we recommend that sandboxes be used with all applications, and we require their use for apps distributed via the Mac App Store. Mandatory access controls Sandboxes are built on low-level access control mechanisms enforced in the kernel by the kauth subsystem. This was introduced in OS X 10.4 Tiger based on work originating in TrustedBSD. kauth identifies a valid actor (typically a process) by its credentials. It then asks one or more listeners to indicate whether that actor can perform a given action within a specified scope (authorization domain). Only the initial (default) listener can allow a request; subsequent listeners can only deny or defer. If all listeners defer, kauth denies the request. Entitlements Sandboxes collect these low-level actions into specific entitlements that an application must explicitly request by adding the appropriate key to a property list file in its application bundle. Entitlements can control access to: • The entire file system • Specific folders • Networking • iCloud • Hardware (for example, the built-in camera or microphone) • Personal information (for example, contacts) In addition, entitlements control whether processes inherit their parents’ permissions and can grant temporary exceptions for sending and receiving events or reading and writing files. User intent While it may seem that virtually all applications would need to request broad entitlements to read and write files, that isn’t the case. OS X tracks user-initiated actions, such as dragging a file onto an application icon, and automatically opens a temporary hole in the sandbox allowing the application to read just that one file. In particular, open and save panels run in a special-purpose PowerBox process that handles all user interaction. This allows applications to only request entitlements for actions they need to perform autonomously. Code signing Entitlements use code signing to ensure the privileges they specify only cover the code originally intended. Code signing uses public key cryptography to verify that the entity that created the entitlements (that is, the developer) is the same as the author of the executable in question, and that neither has been modified.14 Core Technologies Overview OS X Mountain Lion GateKeeper Gatekeeper is a new feature in OS X Mountain Lion that helps protect you from downloading and installing malicious software. Developers can sign their applications, plug-ins, and installer packages with a Developer ID certificate to let Gatekeeper verify that they come from identified developers. Developer ID certificates As part of the Mac Developer Program, Apple gives each developer a unique Developer ID for signing their apps. A developer’s digital signature lets Gatekeeper verify that they have not distributed malware and that the app hasn’t been tampered with. User control Choose the kinds of apps that are allowed to run on OS X Mountain Lion from the following: • Only apps from the Mac App Store, for maximum security • Apps from the Mac App Store as well as apps that have a Developer ID • Apps from anywhere You can even temporarily override higher-protection settings by clicking on the app while holding down the Control key and then choosing Open from the contextual menu. This lets you install and run any app at any time. Gatekeeper ensures that you stay completely in control of your system. You control which kinds of apps you want your system to trust.15 Core Technologies Overview OS X Mountain Lion XPC XPC leverages launchd, GCD, and sandboxing to provide a lightweight mechanism for factoring an application into a family of coordinating processes. This factoring improves launch times, crash resistance, and security by allowing each process to focus on one specific task. No configuration needed XPC executables and xpcservice.plist(5) configuration files are all part of a single app bundle, so there is no need for an installer. Launch-on-demand XPC uses launchd to register and launch helper processes as they are needed. Asynchronous communication XPC uses GCD to send and receive messages asynchronously using blocks. Privilege separation XPC processes each have their own sandbox, allowing clean separation of responsibilities. For example, an application that organizes and edits photographs does not usually need network access. However, it can create an XPC helper with different entitlements whose sole purpose is to upload photos to a photo sharing website. Out of band data In addition to primitive data types such as booleans, strings, arrays, and dictionaries, XPC can send messages containing out-of-band data such as file descriptors and IOSurface media objects.16 Core Technologies Overview OS X Mountain Lion Ethernet Mac systems were the first mass-market computers to ship with built-in Ethernet. OS X today supports everything from 10BASE-T to 10 gigabit Ethernet. The Ethernet capabilities in OS X include the following Automatic link detection. Automatic link detection brings up the network stack whenever a cable is plugged in, and safely tears it down when the cable is removed. Auto-MDIX This feature reconfigures the connection depending on whether you are connecting to a router or another computer, so you no longer need special crossover cables. Autonegotiation Autonegotiaton discovers and uses the appropriate transmission parameters for a given connection, such as speed and duplex matching. Channel bonding Channel bonding supports the IEEE 802.3ad/802.1ax Link Aggregation Control Protocol for using multiple low-speed physical interfaces as a single high-speed logical interface. Jumbo frames This capability uses Ethernet frames of up to 9000 bytes with Gigabit Ethernet switches that allow them. TCP segmentation offload To reduce the work required of the CPU, TCP segmentation offload lets the Network Interface Card (NIC) handle splitting a large outgoing buffer into individual packets. Wi-Fi Apple brought Wi-Fi to the mass market with the original Airport card and continues to provide cutting edge wireless networking across our product lines. Built in to every Mac Every Mac we ship—from the 11-inch Macbook Air to the top-of-the-line Mac Pro—has 802.11n networking built right in, along with 802.11a/b/g compatibility. Network Access17 Core Technologies Overview OS X Mountain Lion AirDrop AirDrop, introduced in OS X 10.7 Lion, makes it easy to safely share files wirelessly with nearby users, even if you aren’t on the same network. AirDrop leverages the wireless hardware on newer Mac systems to find and connect to other computers on an ad hoc basis, even if they are already associated with different Wi-Fi networks. Share files wirelessly with anyone around you using AirDrop. AirPlay AirPlay lets you stream music throughout your entire house—wirelessly. Starting with OS X 10.8 Mountain Lion, you can share audio or mirror your screen from your Mac to an Apple TV or any other AirPlay-enabled device. OS X treats AirPlay as just another audio output device.18 Core Technologies Overview OS X Mountain Lion Multihoming OS X can have multiple network interfaces active at the same time and dynamically determines the optimal one to use for a given connection. Here are some examples of where this is useful: • Connecting to the Internet via Ethernet when you plug a Mac in to the network, but seamlessly switching over to Wi-Fi when the network cable is unplugged. • Routing all corporate traffic through a VPN server for security, while accessing the public Internet directly to reduce latency. • Internet Sharing, where one interface, such as Ethernet, is connected to the public Internet while the other, such as Wi-Fi, acts as a router for connecting your other devices. IPv6 OS X provides best-of-breed support for IPv6, the next-generation 128-bit Internet protocol. Key features of IPv6 in OS X include: • Full support for both stateful and stateless DHCPv6 • Happy Eyeballs algorithm (RFC 6555) for intelligently selecting between IPv6 and IPv4 addresses when both are available • High-level APIs that resolve names directly so applications don’t need to know whether they are using IPv4 or IPv6 • IPv6-enabled user applications (for example, Safari) Remote Access Captive networks Like iOS, OS X now automatically detects the presence of a captive network and prompts for the authentication necessary to reach the public Internet. VPN client OS X includes a virtual private network (VPN) client that supports the Internet standard Layer 2 Tunneling Protocol (L2TP) over IPSec (the secure version of IPv4), as well as the older Point-to-Point Tunneling Protocol (PPTP). OS X also includes a VPN framework developers can use to build additional VPN clients. Firewalls In addition to the ipfw2-based system-wide firewall, OS X includes an application firewall that can be configured to allow only incoming access to preapproved applications and services. Self-tuning TCP OS X sets the initial maximum TCP window size according to the local resources and connection type, enabling TCP to optimize performance when connecting to high-bandwidth/high-latency networks.19 Core Technologies Overview OS X Mountain Lion Port mapping NAT-PMP enables you to export Internet services from behind a NAT gateway, while Wide Area Bonjour lets you register the resulting port number with Back to My Mac. This enables you to easily and securely access your home printer and disk drives remotely, even from the public Internet. Bonjour Bonjour is Apple’s implementation of the Zero Configuration Networking standard. It helps applications discover shared services such as printers on the local network. It also enables services to coordinate within and across machines without requiring well-known port numbers. Bonjour’s ability to painlessly find other computers over a network is critical to many Apple technologies, such as AirPlay and AirDrop. Link-local addressing Any user or service on a computer that needs an IP address benefits from this feature automatically. When your host computer encounters a local network that lacks DHCP address management, it finds an unused local address and adopts it without you having to take any action. Multicast DNS Multicast DNS (mDNS) uses DNS-format queries over IP multicast to resolve local names not handled by a central DNS server. Bonjour goes further by handling mDNS queries for any network service on the host computer. This relieves your application of the need to interpret and respond to mDNS messages. By registering your service with the Bonjour mDNSResponder daemon, OS X automatically directs any queries for your name to your network address. Service discovery Service discovery allows applications to find all available instances of a particular type of service and to maintain a list of named services. The application can then dynamically resolve a named instance of a service to an IP address and port number. Concentrating on services rather than devices makes the user’s browsing experience more useful and trouble-free. Wide Area Bonjour Starting in OS X 10.4, Bonjour now uses Dynamic DNS Update (RFC 2316) and unicast DNS queries to enable discovery and publishing of services to a central DNS server. These can be viewed in the Bonjour tab of Safari in addition to other locations. This feature can be used by companies to publicize their Intranet or by retailers to advertise promotional web sites. High-level APIs OS X provides multiple APIs for publication, discovery, and resolution of network services, as follows: • NSNetService and NSNetServiceBrowser classes, part of the Cocoa Foundation framework, provide object-oriented abstractions for service discovery and publication. • The CFNetServices API declared in the Core Services framework provide Core Foundation-style types and functions for managing services and service discovery. • The DNS Service Discovery API, declared in , provides low-level BSD socket communication for Bonjour services.20 Core Technologies Overview OS X Mountain Lion Wake On Demand Wake on Demand allows your Mac to sleep yet still advertise available services via a Bonjour Sleep Proxy (typically an AirPort Extreme Base Station) located on your network. The proxy automatically wakes your machine when clients attempt to access it. Your Mac can even periodically do a maintenance wake to renew its DHCP address and other leases. Open source The complete Bonjour source code is available under the Apache License, Version 2.0 on Apple’s open source website, where it’s called the mDNSResponder project. You can easily compile it for a wide range of platforms, including UNIX, Linux, and Windows. We encourage hardware device manufacturers to embed the open source mDNSResponder code directly into their products and, optionally, to pass the Bonjour Conformance Test so they can participate in the Bonjour Logo Licensing Program.21 Core Technologies Overview OS X Mountain Lion Auto Save You no longer need to manually save important documents every few minutes, thanks to the new Auto Save facility introduced in OS X 10.7 Lion. Applications that support Auto Save automatically save your data in the background whenever you pause or every five minutes, whichever comes first. If the current state of your document has been saved, OS X won’t even prompt you before quitting the application, making logouts and reboots virtually painless. Automatic Versions Versions, also introduced in OS X 10.7 Lion, automatically records the history of a document as you create and make changes to it. OS X automatically creates a new version of a document each time you open it and every hour while you’re working on it. You can also manually create snapshots of a document whenever you like. OS X uses a sophisticated chunking algorithm to save only the information that has changed, making efficient use of space on your hard drive (or iCloud). Versions understands many common document formats, so it can chunk documents between logical sections, not just at a fixed number of bytes. This allows a new version to store—for example, just the one chapter you rewrote instead of a copy of the entire novel. OS X automatically manages the version history of a document for you, keeping hourly versions for a day, daily versions for a month, and weekly versions for all previous months. To further safeguard important milestones, OS X automatically locks documents that were edited more than two weeks ago. You can change the interval by clicking the Options… button in the Time Machine System Preferences pane, then choosing the interval you want from the Lock documents pop-up menu. When you share a document—for example through email, iChat, or AirDrop—only the latest, final version is sent. All other versions and changes remain safely on your Mac. Document Lifecycle22 Core Technologies Overview OS X Mountain Lion Version Management You can also manually lock, unlock, rename, move, or duplicate documents using the pop-up menu next to the document title, which also shows you the current state of the document. Manage your versions directly from the pop-up menu next to the document title. You can also use the same pop-up menu to browse previous versions using an interface similar to Time Machine. It shows the current document next to a cascade of previous versions, letting you make side-by-side comparisons. You can restore entire past versions or bring elements from past versions such as pictures or text into your working document. Recovering work from previous versions is just a click away. iCloud Storage iCloud Storage APIs enable apps to store documents and key value data in iCloud. iCloud wirelessly pushes documents to your devices and updates them whenever any of your devices change them—all automatically. Ubiquitous storage The iCloud storage APIs let applications write your documents and data to a central location and access those items from all your computers and iOS devices. Making a document ubiquitous using iCloud means you can view or edit those documents from any device without having to sync or transfer files explicitly. Storing documents in your iCloud account also provides an extra layer of protection. Even if you lose a device, those documents are still available from iCloud storage.23 Core Technologies Overview OS X Mountain Lion File coordination Because the file system is shared by all running processes, conflicts can occur when two processes (or two threads in the same process) try to change the same file at the same time. To avoid this type of contention, OS X 10.7 and later include support for file coordinators, which enable developers to safely coordinate file access between different processes or different threads. File coordinators mediate changes between applications and the daemon that facilitates the transfer of the document to and from iCloud. In this way, the file coordinator acts as a locking mechanism for the document, preventing applications and the daemon from modifying the document simultaneously. Safe versions Versions automatically stores iCloud documents. This means iCloud never asks you to resolve conflicts or decide which version to keep. It automatically chooses the most recent version. You can always use the Browse Saved Versions option if you want to revert to a different one. Versions’ chunking mechanism also minimizes the information that needs to be sent across the network. Ubiquitous metadata, lazy content iCloud immediately updates the metadata (that is, the file name and other attributes) for every document stored or modified in the cloud. However, iCloud may not push the actual content to devices until later, perhaps only when actively requested. Devices always know what’s available but defer loading the data in order to conserve storage and network bandwidth.. Peer-to-peer networking iCloud detects when you have multiple devices on the same local network, and it copies the content directly between them rather than going through the cloud. It eventually copies the content to the cloud, as well, to enable remote access and backup. Web access iCloud provides a range of powerful web applications to let you work directly with your data from a web browser. These include the usual personal information tools (Mail, Calendar and AddressBook) as well as a complete suite of iWork viewers (Pages, Keynote, and Numbers).24 Core Technologies Overview OS X Mountain Lion Spotlight Spotlight is a fast desktop search technology that helps you organize and search for files based on either contents or metadata. It’s available to users via the Spotlight window in the upper-right of the screen. Developers can embed Spotlight in their own applications using an API available from Apple. Standard metadata Spotlight defines standard metadata attributes that provide a wide range of options for consistently storing document metadata, making it easier to form consistent queries. These include POSIX-style file attributes, authoring information, and specialized metadata for audio, video, and image file formats. Extensible importers Using OS X Launch Services, Spotlight determines the uniform type identifier of a new or modified file and attempts to find an appropriate importer plug-in. If an importer exists and is authorized, OS X loads it and passes it the path to the file. Third parties can create custom importers that extract both standard and custom metadata for a given file type and return a dictionary which is used to update the Spotlight datastore. Dynamic datastore Every time you create, modify, or delete a file, the kernel notifies the Spotlight engine that it needs to update the system store. OS X accomplishes this with the high-performance fsevents API. Live update Whenever OS X updates the datastore, it also notifies the system results window and any third-party client applications if the update causes different files to match or not match the query. This ensures that the Mac always presents the latest real-time information to the user. Data Management25 Core Technologies Overview OS X Mountain Lion Time Machine Time Machine, introduced in OS X 10.5 Leopard, makes it easy to back up and restore either your entire system or individual files. Easy setup To set up Time Machine, all you need to do is select a local disk or Time Capsule to store the backups. In OS X Mountain Lion, you can select multiple backup destinations for Time Machine. OS X immediately starts backing up all your files in the background. After the initial backup, it automatically creates new incremental backups every hour. Coalescing changes Time Machine leverages the fsevents technology developed for Spotlight to continuously identify and track any folders (what UNIX calls directories) that contain modified files. During the hourly backup, it creates a new folder that appears to represent the entire contents of your hard drive. In reality, it uses a variant of UNIX hard links that mostly point to trees of unmodified folders already on the disk. Those trees are effectively copy-on-write, so that future changes never affect the backup version. TIme Machine creates new trees inside a backup for any path that contains modified folders. Time Machine creates new versions of those folders that contain links to the current files, thus automatically capturing any changes that occurred in the past hour. This avoids the overhead of either scanning every file on disk or capturing each and every change to a file. This technique allows each backup to provide the appearance and functionality of a full backup while only taking up the space of an incremental backup (plus some slight overhead for the metadata of modified trees). This makes it easy to boot or clone a system from the most recent Time Machine backup. Mobile Time Machine OS X 10.7 Lion introduced Mobile Time Machine, which keeps track of modified files even while you are disconnected from your backup drive. When you reconnect, it will automatically record the hourly snapshots to ensure you don’t lose your version history. Preserving backups Time Machine keeps hourly backups for the past 24 hours, daily backups for the past month, and weekly backups until your backup drive is full. At that point OS X warns you that it is starting to delete older backups. To be notified whenever OS X deletes an older backup, open Time Machine preferences, click the Options... button, and check the box next to Notify after old backups are deleted.26 Core Technologies Overview OS X Mountain Lion LLVM The next-generation LLVM compiler suite is based on the open source LLVM.org project. The LLVM.org project employs a unique approach of building compiler technologies as a set of libraries. Capable of working together or independently, these libraries enable rapid innovation and provide the ability to attack problems never before solved by compilers. Apple’s compiler, runtime, and graphics teams are extensive contributors to the LLVM.org community. They use LLVM technology to make Apple platforms faster and more secure. Clang front-end Clang is a high-performance front-end for parsing C, Objective-C, and C++ code as part of the LLVM compiler suite. It supports the latest C++ standards, including a brand-new implementation of the C++ standard libraries. Clang is also implemented as a series of libraries, allowing its technology to be reused for static code analysis in Xcode and the LLDB debugger. Comprehensive optimization LLVM’s flexible architecture makes it easy to add sophisticated optimizations at any point during the compilation process. For example, LLVM performs whole-program analysis and link-time optimizations to eliminate unused code paths. Automatic Reference Counting Automatic Reference Counting (ARC) for Objective-C lets the compiler take care of memory management. By enabling ARC with the new Apple LLVM compiler, you never need to manually track object lifecycles using retain and release, dramatically simplifying the development process while reducing crashes and memory leaks. The compiler has a complete understanding of your objects and releases each object the instant it is no longer used. Apps run as fast as ever, with predictable, smooth performance. Developer Tools27 Core Technologies Overview OS X Mountain Lion Xcode Xcode 4 is the latest version of Apple’s integrated development environment (IDE), a complete toolset for building OS X and iOS applications. The Xcode IDE includes a powerful source editor, a sophisticated graphical UI editor, and many other features from highly customizable builds to support for source code repository management. Xcode can help you identify mistakes in both syntax and logic and will even suggest fixes. The Xcode 4 integrated development environment Static analysis You can think of static analysis as providing you advanced warnings by identifying bugs in your code before it is run—hence the term static. The Xcode static analyzer gives you a much deeper understanding of your code than do traditional compiler warnings. The static analyzer leverages the Clang libraries to travel down each possible code path, identifying logical errors such as unreleased memory—well beyond the simple syntax errors normally found at compile time. Fix-it Fix-it brings autocorrection from the word processor to your source code. The Xcode Fix-it feature checks your symbol names and code syntax as you type, highlights any errors it detects, and even fixes them for you. Fix-it marks syntax errors with a red underbar or a caret at the position of the error and a symbol in the gutter. Clicking the symbol displays a message describing the possible syntax error and, in many cases, offers to repair it automatically. 28 Core Technologies Overview OS X Mountain Lion Interface Builder Interface Builder is a graphical tool for designing user interfaces for OS X and iOS applications. Like other Xcode editors, Interface Builder is fully integrated into the application, so you can write and edit source code and tie it directly to your user interface without leaving the Xcode workspace window. Interface Builder, the easiest way to design your application’s user interface. Version control Xcode provides several ways to save versions of your project: • A snapshot saves the current state of your project or workspace on disk for possible restoration later. • Source control repositories keep track of individual changes to files and enable you to merge different versions of a file. • An archive packages your products for distribution, either through your own distribution mechanism or for submission to the App Store. Editor area Utility area Interface Builder objects Dock Canvas Inspector selector bar Library selector bar Library pane Inspector pane29 Core Technologies Overview OS X Mountain Lion Xcode also provides direct support for Git and Subversion repositories, including an option to create a local Git repository when you create a new project. Because it’s so easy to set up a repository to use with your Xcode project, Xcode provides a special editor, called the version editor, that also makes it easy to compare different versions of files saved in repositories. The Xcode version editor. Instruments Instruments is an application for dynamically tracing and profiling OS X and iOS code. It is a flexible and powerful tool that lets you track one or more processes, examine the collected data, and track correlations over time. In this way, Instruments helps you understand the behavior of both user programs and the operating system.30 Core Technologies Overview OS X Mountain Lion With the Instruments application, you use special tools (known as instruments) to trace different aspects of a process’s behavior. You can also use the application to record a sequence of user interface actions and replay them, using one or more instruments to gather data. Instruments includes Instruments, Track, and Extended Detail panes. Synchronized tracks The Instruments Track pane displays a graphical summary of the data returned by the current instruments. Each instrument has its own track, which provides a chart of the data collected by that instrument. The information in this pane is read-only. You use this pane to select specific data points you want to examine more closely. Multiple traces Each time you click the Record button in a trace document, Instruments starts gathering data for the target processes. Rather than appending the new data to any existing data, Instruments creates a new trace run to store that data. This makes it easy to compare behavior between different configurations. A trace run consists of all of the data gathered between the time you click the Record button and the Stop button. By default, Instruments displays only the most recent trace run in the Track pane, but you can view data from previous trace runs in one of two ways: • Use the Time/Run control in the toolbar to select which trace run you want to view. • Click the disclosure triangle next to an instrument to display the data for all trace runs for that instrument. Extended Detail pane Toolbar Detail pane Navigation bar Intruments pane Track pane31 Core Technologies Overview OS X Mountain Lion User interface recording A user interface track records a series of events or operations in a running program. After the track records events, you can replay that track multiple times to reproduce the same sequence of events over and over. Each time you replay a user interface track, you can collect data using other instruments in your trace document. The benefit of doing this is that you can then compare the data you gather on each successful run and use it to measure the changes in your application’s performance or behavior. DTrace DTrace is a dynamic tracing facility available for Mac systems since OS X 10.5 Leopard. Because DTrace taps into the operating system kernel, you have access to low-level information about the kernel itself and about the user processes running on your computer. DTrace is used to power many of the built-in instruments. DTrace probes make it easy to use Instruments to create custom instruments. A probe is a sensor you place in your code that corresponds to a location or event (such as a function entry point) to which DTrace can bind. When the function executes or the event is generated, the associated probe fires and DTrace runs whatever actions are associated with the probe. Most DTrace actions simply collect data about the operating system and user program behavior at that moment. It is possible, however, to run custom scripts as part of an action. Scripts let you use the features of DTrace to fine tune the data you gather. That data is then available as an Instruments track to compare with data from other instruments or other trace runs. Accelerate Accelerate is a unique framework of hardware-optimized math libraries that provides the following: • Vector digital signal processing (vDSP). Optimized Fast Fourier Transforms (FFTs), convolutions, vector arithmetic, and other common video and audio processing tasks for both single- and double-precision data. • Vector image processing (vImage). Optimized routines for convolutions, compositing, color correction, and other image-processing tasks, even for gigapixel images. • vForce. Designed to wring optimal efficiency from modern hardware by specifying multiple operands at once, allowing only default IEEE-754 exception handling. • Linear Algebra Package (LAPACK). Industry-standard APIs written on top of BLAS for solving common linear algebra problems. • Basic Linear Algebra Subprograms (BLAS) Levels I, II, and III. High-quality “building block” routines that perform basic vector and matrix operations using standard APIs. • vMathLib. A vectorized version of libm that provides transcendental operations, enabling you to perform standard math functions on many operands at once.32 Core Technologies Overview OS X Mountain Lion Automation AppleScript AppleScript is Apple’s native language for application automation, as used by the AppleScript Editor. Its English-like syntax generates Apple events, which use a scripting dictionary (provided by most Mac applications) to programmatically create, edit, or transform their documents. AppleScript and other Open Scripting Architecture (OSA) scripts can be activated by contextual menus, user interface elements, iCal events, and even folder actions, such as drag and drop. Automator Automator provides a graphical environment for assembling actions (typically built from AppleScript or shell scripts) into sophisticated workflows, which can be saved as either standalone applications or as custom services, print plugins, folder actions, iCal alarms, and Image Capture plugins. Apple events The Apple Event Bridge framework provides an elegant way for Cocoa applications (including bridged scripting languages) to generate Apple events based on an application’s dictionary, even generating appropriate header files if necessary. Services The Services menu lets you focus on only those actions relevant to your current selection, whether in the menu bar, the Finder action menu, or a contextual menu. Individual services can also be disabled and assigned shortcuts from the Keyboard pane in System Preferences. WebKit WebKit is an open source web browser engine developed by Apple. WebKit’s HTML and JavaScript code began as a branch of the KHTML and KJS libraries from KDE. WebKit is also the name of the OS X system framework version of the engine that’s used by Safari, Dashboard, Mail, and many other OS X applications Key features include: • Lightweight footprint • Great mobile support • Rich HTML5 functionality • Easy to embed in Cocoa and Cocoa touch applications • Available as open source at webkit.org33 Core Technologies Overview OS X Mountain Lion © 2012 Apple Inc. All rights reserved. Apple, the Apple logo, AirPlay, Airport, AirPort Extreme, Apple TV, AppleScript, Back to My Mac, Bonjour, Cocoa, iCloud, MacBook, MacBook Air, Mac Pro, OS X, Safari, Spotlight, Time Machine, and Xcode are trademarks of Apple Inc., registered in the U.S. and other countries. AirDrop and Open CL are trademarks of Apple Inc. App Store and iTunes Store are service marks of Apple Inc., registered in the U.S. and other countries. Intel, Intel Core, and Xeon are trademarks of Intel Corp. in the U.S. and other countries. UNIX® is a registered trademark of The Open Group. Other product and company names mentioned herein may be trademarks of their respective companies. June 2012 L516500A For More Information For more information about OS X Mountain Lion, visit www.apple.com/macosx. • Extensible Firmware Interface (EFI): See www.uefi.org • I/OKit: See Kernel Programming Guide: I/O Kit Overview • Partition Schemes: See Technical Note TN2166: Secrets of the GPT • Recovery Partitions: See OS X Lion: About Lion Recovery. • Full-Disk Encryption: See OA X Lion: About FileVault 2. • Backup: See Mac 101: Time Machine. • File System Events: See Spotlight Overview • Launchd: See the Daemons and Services Programming Guide • Grand Central Dispatch (GCD): See the Concurrency Programming Guide • Sandboxes: See Code Signing Guide • Gatekeeper: See Distributing Outside the Mac App Store • Bonjour: See Bonjour Overview. • XPC: See Daemons and Services Programming Guide: Creating XPC Services. • iCloud: See What’s New In OS X: iCloud Storage APIs • LLVM: See The LLVM Compiler Infrastructure Project • Xcode: See Xcode 4 User Guide • Instruments: See Instruments User Guide • WebKit: See WebKit Objective-C Programming Guide. For More Information OS X Server Product Overview June 2012Contents Page 4 OS X Server Page 6 Server App Simplified Setup Alerts Using Push Notifications Page 7 File Sharing Connection Monitoring File Sharing for Mac, PC, and iPad Standards-Based File Services Flexible File Permissions Spotlight Searching Page 9 Wiki Server Simplified Content Creation Optimized for iPad WebDAV Access Quick Look Page 11 Profile Manager Mobile Device Management Web-Based Administration Self-Service Portal Management Options Page 13 Time Machine Backups Server Backup Page 14 Mail Server Standards-Based SMTP, IMAP, and POP Server Push Notifications Safe and Secure Optimized for Mobile Clients Page 15 Contacts Server Sharing Contacts Standards-Based CardDAV Server Global Address Books Push Notifications OS X Server 2 Product OverviewOS X Server 3 Product Overview Page 17 Calendar Server Standards-Based CalDAV Server Email Invites Page 18 Messages Server Group Collaboration Made Easy Page 19 Websites Virtual Hosting, Including Multiple IP Addresses and Virtual Domains Encrypted Data Transport Using SSL Dynamic Web Content Page 20 VPN Server Standards-Based Protocols VPN On Demand Page 21 NetInstall Page 22 Software Update Server Automatically Download Updates and Cache Them Locally Page 23 Xsan Volume Management Metadata Controller Failover and File System Journaling Real-Time Monitoring, Graphs, and Event Notifications Page 24 Server Fundamentals High-Performance Networking Advanced Server Features Security and Access Controls Page 25 Tech Specs System Requirements Languages Pricing Additional ResourcesOS X Server Product Overview 4 OS X Server is available for $19.99 as an easy download from the Mac App Store. The new OS X Server brings more power to your business, home office, or school. OS X Server makes it easy for your Mac to share data with your iPhone, iPad, and iPod touch, schedule meetings, synchronize contacts, host your own websites, publish wikis, remotely access your network, and more. Following are the key features of OS X Server: File Sharing. Share documents, folders, and exchange files between multiple computers— Mac or PC. And with wireless file sharing for iPad, users can access, copy, and share documents on the server from within applications such as Keynote, Numbers, and Pages. Wiki Server. Improve group collaboration using wikis. Users can create new wikis, add content, formatting, tag, and cross-reference material, upload files and images, add comments, view revision history, and share documents. Profile Manager. Simplify deployment and management using configuration profiles for OS X computers and iOS devices. Time Machine Backups. Use your server as a Time Machine backup destination for all the Mac computers on your network. Mail Server. Standards-based mail services allow OS X Server to work with email clients on the iPhone, iPad, Mac, and PC. Push notifications ensure iPhone and iPad users are immediately notified when they receive new mail messages. Contacts Server. Be more productive by enabling contacts to be shared and kept in sync on your iPhone, iPad, and Mac. OS X ServerOS X Server 5 Product Overview Calendar Server. Easily share calendars, schedule meetings, and coordinate events within your organization. OS X Server provides real-time access to your calendar from your iPhone, iPad, Mac, or web browser. Messages Server. Transfer files securely, share a persistent chat room, conduct an audio conference, or even broadcast a presentation, movie, or photo slideshow to other people using Messages with OS X Mountain Lion. Web Server. Your complete, easy-to-use web hosting solution. You don’t need to be an experienced webmaster to set up websites and host them on OS X Server. VPN Server. Allow users to securely connect to your organization’s network services and confidential information while at home or away from the office. NetInstall. Save time by automating the deployment of software installation and upgrades across your network. Software Update Server. Automatically download Mac software updates and cache them locally. Xsan. Built into OS X, the Xsan file system allows any Mac with appropriate connectivity to access an Xsan volume. OS X Server includes the Xsan Admin application for hosting and configuring Xsan volumes.OS X Server 6 Product Overview The Server app is a powerful tool for managing OS X Server. In one place, it gives you control over managing users and groups and setting up key services such as file sharing, calendaring, messaging, mail, wikis, secure remote access, and backup settings for network clients. Simplified Setup Configuring OS X Server is almost as easy as configuring a desktop computer. Simply launch the Server app. An assistant walks you through the initial setup and helps verify network settings and define your administrator account. Next add users and groups and enable the network services you want to deliver to your organization. Alerts Using Push Notifications The Server app also makes it easy to maintain your server. In addition to email, OS X Server can send push notifications to alert you about new software updates, unresponsive volumes, hard drives that are getting full, and users that have exceeded their mail quota. Server App Designed for the future. Server App features full support for IPv6 services and addressing.OS X Server 7 Product Overview Whether you’re supporting a creative team, a distributed sales force, a class of students, or just about any small business or workgroup, you know your users need to share information to work effectively. OS X Server makes it as easy for users to share files between Mac computers, iPad devices, and PCs as if they were using the files locally. Connection Monitoring See who is accessing your server. File-sharing connection monitoring gives you the status of who is connected, how long they have been connected, and whether they are idle or not. In addition, you can send users notification messages and warn them if the server is going offline. File Sharing for Mac, PC, and iPad Share documents, folders, and exchange files between multiple computers—Mac or PC. And with wireless file sharing for iPad, users can access, copy, and share documents on the server from within applications such as Keynote, Numbers, and Pages. File Sharing Why use a server? Productivity is greatly enhanced when users store work in centralized folders rather than on individual computers. With centralized file storage, all users have access to the same up-to-the-minute file. Because a single version resides on the server, there won’t be any confusion about multiple versions of the same document. And users won’t need to worry about losing important data in the event of a system failure or a lost or stolen laptop. The file is always safe on the server.OS X Server 8 Product Overview Standards-Based File Services OS X Server makes it easy for you to set up central network storage that’s accessible to clients throughout your organization. Using native protocols, OS X Server delivers file services to all the clients on your network: AFP for Mac, SMB/CIFS for PC, NFS for UNIX and Linux, WebDAV for iPad, and FTP for Internet clients. These flexible, cross-platform file services enable groups to work more efficiently when sharing resources, archiving projects, and backing up important documents. Flexible File Permissions OS X Server supports both traditional UNIX file permissions and access control lists (ACLs), offering administrators an unprecedented level of control over file and folder permissions. With file system ACLs, any file object can be assigned multiple users and groups, including groups within groups. Each file object can also be assigned both allow and deny permissions, as well as a granular set of permissions for administrative control, read, write, and delete operations. Spotlight Searching Designed for workgroups with shared documents, projects, and files, the built-in Spotlight Server delivers lightning-fast search results for content stored on the server. Powerful search options such as Boolean logic, quoted phrase searching, category labels, and range support make it easy to locate content in a flash. Content indexing occurs on the server—automatically and transparently—keeping search results up-tothe-moment accurate. To safeguard your organization’s data, Spotlight searching works with access controls in OS X Server, so users see only the search results they have permission to view. This makes it easy for everyone in a group to store files in a single shared location while protecting confidential information from unauthorized access.OS X Server 9 Product Overview OS X Server makes it easy for groups to collaborate and communicate using wikis. With wikis, users can add content, formatting, tag, and cross-reference material, upload files and images, add comments, view revision history, and share documents. And because the wiki content is web based, it is easily accessible from your iPad, iPhone, Mac, or PC. Simplified Content Creation Editing a wiki is easy. An intuitive edit toolbar makes it easy for users to customize fonts, add text, tables, and charts, and attach files, including audio and video. No syntax, HTML, or markup required. You can even customize your wiki look and feel with your own icon, color scheme, banner, and background image. Wiki ServerOS X Server 10 Product Overview Optimized for iPad Wiki Server has an elegant, new touch-based design, giving iPad users faster, more powerful ways to create, edit, and share information. In Safari on iPad, wikis appear as tidy stacks—just tap to take a peek inside. Or tap to reveal recent activity, view change history, or add comments. WebDAV Access iPad users can now open and save attachments from a wiki directly within applications such as Keynote, Numbers, and Pages. Quick Look One of the most useful features of Wiki Server is Quick Look. By clicking the Quick Look icon next to a file attachment on a wiki, users can view the document without downloading it. Quick Look supports all standard file formats, including Word, Excel, PowerPoint, Pages, Numbers, Keynote, QuickTime, PDF, and text documents.OS X Server 11 Product Overview OS X Server is ideal for schools and businesses that need to simplify the deployment, configuration, and management of computers and devices in the organization. Mobile Device Management Profile Manager delivers configuration-based profile setup and Mobile Device Management (MDM) for Mac computers running OS X and iOS devices such as iPad, iPhone, and iPod touch. It simplifies creation of user accounts for mail, calendars, contacts, and chat, enforcement of restrictions and PIN and password policies, configuration of system settings, and more. Web-Based Administration Featuring a web-based administration console, Profile Manager enables management from web browsers such as Safari. Administrators can define profile settings for individual users, groups, devices, and groups of devices. For group-based management, Profile Manager easily integrates with directory services such as Open Directory, Active Directory, and LDAP. Profile ManagerOS X Server 12 Product Overview Self-Service Portal To simplify profile deployment, Profile Manager includes a web portal where users can download and install new configuration profiles for their Mac, iPad, iPhone, or iPod touch. Users can access this portal in Safari to manage their passcode, set the startup password for their Mac, or remotely lock and wipe devices that have been lost or stolen. Management Options Accounts • Email, calendar, contacts, and messages • Exchange • LDAP, CalDAV, and CardDAV • Subscribed calendars • VPN, Wi-Fi • 802.1x settings and digital certificates • Web clips • APN, SCEP, and proxy server iOS Policies and Restrictions • Passcode age, length, and complexity • Application launch restrictions • YouTube • iTunes Store • Safari • Camera • Voice calling • Encryption • Content ratings • iCloud • Siri • Photo Stream • Game Center OS X Policies and Restrictions • System Preferences • Media access restrictions • Gatekeeper • Directory services • Dock settings • Login window and items • Mobility • Software Update • Printers • Energy Saver • Parental controlsOS X Server 13 Product Overview OS X Server can act as a designated Time Machine backup for all the Mac computers on your network. Centralizing your backup storage helps protect valuable data, free up disk space on individual drives, and eliminate the need for separate backup drives. Server Backup OS X Server takes advantage of Time Machine to back up your server data—including shared files, calendars, mail, wikis, and so on—to another hard drive, letting you easily restore your server to an earlier configuration. Time Machine BackupsOS X Server 14 Product Overview OS X Server is the ideal solution for companies who need email access in the office or while on the go. With OS X Server, you can bring email in house and use your own domain name rather than rely upon your ISP to host your email. Standards-Based SMTP, IMAP, and POP Server Based entirely on open Internet standards, OS X Server provides mail services that work with email clients on the iPhone, iPad, Mac, and PC. Push Notifications With integration into Apple’s push notification service, OS X Server can immediately notify iPhone and iPad users when they receive new mail messages. Safe and Secure OS X Server uses security technologies to encrypt your confidential email communication. In addition, it features adaptive filtering and virus detection systems to protect your network from unwanted junk mail and destructive viruses. OS X Server analyzes the content of each mail message and trains itself to recognize—and filter out—marginal mail. It also scans both email messages and attachments for viruses and quarantines and deletes them before they can make their way into your organization. Optimized for Mobile Clients OS X Server improves speed and responsiveness when accessing mail from a mobile device. It features advanced IMAP protocol support that enables server-side document searching of text and attachments, attachment compression, and attachment forwarding without requiring a download. Mail ServerOS X Server 15 Product Overview Accessing an up-to-date list of contacts is critical to the operation of any business. OS X Server keeps your business and employees productive by enabling contacts to be shared and kept in sync on your iPhone, iPad, and Mac. Sharing Contacts With OS X Server, you can share and synchronize contacts—such as a list of customers, suppliers, or employees—with other users, devices, and computers in your organization. Contact information updated by one user is immediately available to everyone accessing the shared CardDAV account. Standards-Based CardDAV Server Contacts Server uses the CardDAV protocol standard supported in iOS and OS X for exchange of contact data. Users manage their contacts directly within Contacts on their iPhone, iPad, or Mac. The information is then stored on OS X Server, allowing users immediate access to the new and modified contacts within applications such as Mail, Messages, and FaceTime. Contacts ServerOS X Server 16 Product Overview Global Address Books Contacts Server delivers real-time search results from individually managed contacts in addition to contacts stored in your company’s existing LDAP directory. Push Notifications With integration into Apple’s push notification service, OS X Server can immediately notify users when contacts are added or modified.OS X Server 17 Product Overview OS X Server makes it easy to share calendars, schedule meetings, and coordinate events within your organization. OS X Server provides real-time access to your calendar from your iPhone, iPad, Mac, or web browser. You and your colleagues can propose meetings, book conference rooms, reserve resources, and add comments quickly and easily. You can even attach files—such as agendas, to-do lists, presentations, and movies—to the invitation. Standards-Based CalDAV Server Calendar Server uses the industry-standard CalDAV protocol for calendar scheduling and sharing. Users access their calendar information directly within the Calendar application on their iPhone, iPad, or web browser. Email Invites Need to invite someone who is not in your organization? No problem. Just add their email address to the meeting proposal and OS X Server sends them an email invitation, then shares their response with the rest of the meeting attendees. Calendar Server Push notifications Calendar Server is integrated with Apple’s push notification services, so you and your colleagues find out immediately when there’s a new meeting invitation or a change to an upcoming event.OS X Server 18 Product Overview Bring the power of collaborative instant messaging to your organization. With Messages Server, users can transfer files securely, share a persistent chat room, conduct an audio conference, or even broadcast a presentation, movie, or photo slideshow to other people using Messages with Mountain Lion. Group Collaboration Made Easy Messages Server works with OS X to automatically populate users’ buddy lists with members of the groups to which they belong, so it’s easy for them to start communicating. And thanks to store-and-forward functionality, Messages Server allows users to send messages to buddies who are online, combining the advantages of instant messaging and email. Messages users can request Messages Server to create and host a persistent chat room. Perfect for virtual-team scenarios, project-specific discussions, and real-time, blow-by-blow updates, the chat room allows individuals to join at any time, leave when they need to—even log out and shut down—and still come back to review all communications from the time the chat room opened. Messages Server Standards based Messages Server uses the Jabber instant messaging protocol. Also known as XMPP, the Jabber protocol enables support for Mac computers using Messages, as well as for other Jabber clients on iPhone, iPad, and PCs.OS X Server 19 Product Overview You don’t need to be an experienced webmaster to set up websites and host them on OS X Server. Web Server is preconfigured with default settings, so deployment is as simple as turning it on. Any HTML content saved to the server’s default web folder will be served over the Internet automatically. Virtual Hosting, Including Multiple IP Addresses and Virtual Domains OS X Server takes the complexity out of configuring, hosting, and managing websites. You can configure individual security options, index files, and access controls, and you can host dynamic web applications on a per-site basis. Encrypted Data Transport Using SSL OS X Server features integrated support for strong encryption and authentication using digital SSL certificates. Dynamic Web Content OS X Server is extremely flexible, so you can add dynamic content for more interactive websites and applications. Web Server supports dynamic content generated by Server Side Includes, PHP, Apache modules, and CGIs. OS X Server even makes it easy to install third-party web apps such as Mailman, Roundcube, Moodle, WordPress, Druple, and others. WebsitesOS X Server 20 Product Overview OS X Server allows users to securely connect to your organization’s network services and confidential information while at home or away from the office. Virtual private network (VPN) access enables your offsite users to securely access network services while preventing access by unauthorized individuals. Standards-Based Protocols OS X Server supports the standards-based L2TP/IPSec and PPTP tunneling protocols to provide encrypted VPN connections for iPad, iPhone, Mac, and PCs. These VPN services use highly secure authentication methods, including MS-CHAP and network-layer IPSec. VPN On Demand When using Profile Manager, administrators can now define VPN on-demand profiles to provide seamless, secure access to your organization’s network. VPN on demand allows your Mac to establish a secure connection to the VPN server without requiring the user to bring up the connection manually. VPN ServerOS X Server 21 Product Overview Designed for administrators who manage operating system installations and software updates for their organizations, NetInstall performs automated software installations, whether it’s a new version of the operating system, a specific suite of applications for a workgroup, or both. NetInstall saves time and eliminates the expense of distributing software on disk and the need for administrators to configure each system in person. NetInstallOS X Server 22 Product Overview By deploying Software Update Server, administrators can control how and when client computers download software, enabling access to approved software updates only. This prevents users from selecting software that’s unsuitable for the organization. At the same time, a local software update server streamlines network use, saving the cost of multiple downloads of the same update and reducing unnecessary bandwidth consumption. Automatically Download Updates and Cache Them Locally Software Update Server acts as a proxy for software updates for OS X. This caching server allows administrators to control when and how software updates become available for users’ systems. Software Update Server is capable of automatically mirroring updates between the Apple software update server and your local server to guarantee that the most current updates are immediately available. Software Update ServerOS X Server 23 Product Overview Xsan is a 64-bit cluster file system specifically designed for small and large computing environments that demand the highest level of data availability. This specialized technology enables multiple Mac computers to share RAID storage volumes over a high-speed Fibre Channel network. Each client can read and write directly to the centralized file system, accelerating user productivity while improving workgroup collaboration. Because everyone can work with the same files on the network, Xsan dramatically improves the efficiency of post-production and other data-intensive workflows. The Xsan file system is built into OS X, allowing any Mac with appropriate connectivity to access an Xsan volume. OS X Server includes the Xsan Admin application for hosting and configuring Xsan volumes. Volume Management Xsan allows you to create storage pools made of identical sets of LUNs and stripe them together for fastest-possible performance. Different pools offering special storage characteristics can be combined into volumes; data placement settings, or affinities, enable you to direct data to specific volumes depending on performance and protection requirements. Metadata Controller Failover and File System Journaling Xsan has a high-availability design that allows users to access mission-critical data even in the event of a system or Fibre Channel network failure. Metadata controller failover protects storage availability from server hardware failure. File system journaling tracks modifications to metadata, enabling quick recovery of the file system in case of unexpected interruptions in service. And Fibre Channel multipathing allows file system clients to automatically use an alternate data path should a failure occur. Real-Time Monitoring, Graphs, and Event Notifications For day-to-day SAN management, OS X Server includes the Xsan Admin application. Xsan Admin makes it easy to manage and monitor your SAN and to receive notifications about impending issues. XsanOS X Server 24 Product Overview OS X Server takes advantage of the UNIX-compliant foundation of OS X. This rock-solid core provides the stability, performance, and security that organizations require—and full UNIX conformance ensures compatibility with existing server and application software. High-Performance Networking Incorporating the latest industry-standard networking and security protocols, OS X uses the time-tested BSD sockets and TCP/IP stack to provide compatibility and integration with IP-based networks. A fully multithreaded IP stack and advanced process- and thread-scheduling algorithms enable OS X to efficiently service requests—even when hundreds of users are simultaneously connected to the server. From the lowest levels of the kernel to everyday applications, performance gains are especially noticeable on the latest Intel multicore systems. Advanced Server Features OS X features an industrial-strength design required for business-critical server deployments. “Headless” operation allows administrators to install and configure services without needing to connect a display to the server. Powerful remote administration tools permit secure service management from anywhere on the network or over the Internet, and support for SSH provides secure access from the UNIX command line. To keep critical services up and running, OS X has built-in tools for monitoring systems, preventing accidental shutdown, and recovering services quickly in case of network or power failure. Security and Access Controls OS X is designed to be secure right out of the box—no security expertise is required. Included are features that keep your systems secure such as advanced security architectures, a built-in firewall, and strong encryption and authentication technologies. Server FundamentalsOS X Server 25 Product Overview System Requirements • Mac computer running OS X Mountain Lion • 10GB of available space • Some features require an Apple ID; terms apply. • Some features require a compatible Internet service provider; fees may apply. Languages English, Chinese, Dutch, French, German, Italian, Japanese, Korean, Spanish Pricing Anyone can quickly and easily turn a Mac running Mountain Lion into a server that’s perfect for home offices, businesses, schools, and hobbyists alike. OS X Server is an application you can add to Mountain Lion right from the Mac App Store for $19.99. Additional Resources • Documentation: http://www.apple.com/osx/server/documentation/ • Training and certification: http://training.apple.com • Product support: http://www.apple.com/support/ Tech Specs © 2012 Apple Inc. All rights reserved. Apple, the Apple logo, FaceTime, iPad, iPhone, iPod touch, Keynote, Mac, Numbers, OS X, Pages, QuickTime, Safari, Siri, Spotlight, Time Machine, and Xsan are trademarks of Apple Inc., registered in the U.S. and other countries. iCloud and iTunes Store are service marks of Apple Inc., registered in the U.S. and other countries. Intel, Intel Core, and Xeon are trademarks of Intel Corp. in the U.S. and other countries. IOS is a trademark or registered trademark of Cisco in the U.S. and other countries and is used under license. UNIX® is a registered trademark of The Open Group. Other product and company names mentioned herein may be trademarks of their respective companies. June 2012 L516499A Apple Server Diagnostics User Guide For Version 3X109KApple Inc. © 2011 Apple Inc. All rights reserved. Under the copyright laws, this manual may not be copied, in whole or in part, without the written consent of Apple. The Apple logo is a trademark of Apple, Inc., registered in the U.S. and other countries. Use of the “keyboard” Apple logo (Option-Shift-K) for commercial purposes without the prior written consent of Apple may constitute trademark infringement and unfair competition in violation of federal and state laws. Every effort has been made to ensure that the information in this manual is accurate. Apple is not responsible for printing or clerical errors. Apple 1 Infinite Loop Cupertino, CA 95014 408-996-1010 www.apple.com Apple, the Apple logo, FireWire, Mac, Macintosh, the Mac logo, and Mac OS are trademarks of Apple Inc., registered in the U.S. and other countries. Finder and the FireWire logo are trademarks of Apple Inc. Other company and product names mentioned herein are trademarks of their respective companies. Mention of third-party products is for informational purposes only and constitutes neither an endorsement nor a recommendation. Apple assumes no responsibility with regard to the performance or use of these products. Simultaneously published in the United States and Canada. 019-2146/2011-075 Chapter 1: Overview and Requirements 5 Overview of Server Diagnostics configurations 6 Requirements 7 Chapter 2: Installation 7 Install Server Diagnostics EFI 8 Install Server Diagnostics Mac OS X 9 Set up a NetBoot server 10 Chapter 3: Use Server Diagnostics 10 Change the startup disk 11 About Server Diagnostics modes 11 Remotely test a client server 13 Test the local server using Server Diagnostics EFI 13 Test the local server using Server Diagnostics Mac OS X 14 Use Server Diagnostics EFI 14 Use Server Diagnostics Mac OS X 3 Contents 5 Apple Server Diagnostics tests your server for hardware issues. You can run Apple Server Diagnostics in Extensible Firmware Interface (EFI), which is referred to as Server Diagnostics EFI, or in Mac OS X, which is referred to as Server Diagnostics Mac OS X. Run Server Diagnostics EFI to diagnose hardware issues that prevent Mac OS X from successfully starting up. Run Server Diagnostics Mac OS X to remotely diagnose hardware issues or to diagnose issues that are not tested in Server Diagnostics EFI. Overview of Server Diagnostics configurations You can install and run Server Diagnostics in the following ways: Method Do this because Use the preinstalled Server Diagnostics EFI No installation is necessary. Install Server Diagnostics EFI or Server Diagnostics Mac OS X on a portable storage device You can use the same portable storage device to test multiple servers. Install Server Diagnostics EFI or Server Diagnostics Mac OS X on the hard disk You don’t need a portable storage. Host a NetBoot server You can use a single Server Diagnostics EFI install image to test multiple servers. 1 Overview and RequirementsRequirements Before you can run Server Diagnostics, you must meet installation, local, and remote requirements. Installation requirements To install Server Diagnostics, you need the following:  You need a Mac Pro or Mac mini server with Mac OS X v10.7 or later installed.  If you’re installing onto a portable storage device, you need a USB 2.0 flash drive, or a USB 2.0 or FireWire hard drive.  If you’re installing Server Diagnostics EFI, you need an empty volume with 100 MB of available space but doesn’t have Mac OS X installed.  If you’re installing Server Diagnostics Mac OS X, you need an empty volume with 10 GB, which will be used for a dedicated Mac OS X installation. Local and remote requirements To run Server Diagnostics remotely, you need:  A computer with Mac OS X v10.6 or later installed. This computer is referred to as the host computer.  A server with Mac OS X v10.7 or later installed. This server is referred to as the client server.  A network connection with DHCP active from the host computer to the client server.  If the client server runs Server Diagnostics EFI and uses a network connection, the network connection must use a built-in Ethernet port, not an Ethernet adapter card.  The client server must have Server Diagnostics installed on an internal volume or on a connected portable storage device, or it must be able to run Server Diagnostics from a NetBoot server.  The host computer must run Server Diagnostics Mac OS X. The client server can run Server Diagnostics EFI or Server Diagnostics Mac OS X.  If the client server is running Server Diagnostics Mac OS X, you must be able to log in to the root account. The root account gives a system administrator complete access to the server. NetBoot server requirements To host Server Diagnostics EFI on a NetBoot server, your NetBoot server must:  Have Mac OS X v10.7 with server components installed.  Be on the same subnet as the server being tested.  Have 100 MB of hard disk space available for a Server Diagnostics NetBoot image. 6 Chapter 1 Overview and Requirements 7 Before you can run Server Diagnostics, you must set up your testing environment and install Server Diagnostics. Make sure you meet Server Diagnostics requirements before attempting setup and installation. For information, see “Requirements” on page 6. Server Diagnostics EFI is preinstalled on the server. The instructions in this chapter show you how to install Server Diagnostics in a different location or set up a NetBoot server. Install Server Diagnostics EFI If you perform this task to install Server Diagnostics EFI on an internal volume on the server, you need administrator access to the server. If you perform this task to install Server Diagnostics EFI on a portable storage device, you can use any computer that you have administrator access to. To install Server Diagnostics EFI: 1 Use Disk Utility to set up an empty volume with a partition map scheme of GUID Partition Table, that has at least 100 MB, and that is formatted as MS-DOS (FAT). For information about using Disk Utility, see Disk Utility Help. 2 On the server, open AppleServerDiagnosticsEFI.pkg. 3 Follow the onscreen instructions and, at the Select Destination step, choose a volume that has at least 100 MB of available space and doesn’t have Mac OS X installed. 4 If you’re asked to authenticate, authenticate as a user with administrator privileges. 2 InstallationInstall Server Diagnostics Mac OS X If you perform this task to install Server Diagnostics Mac OS X on an internal volume, you need administrator access to the server. If you perform this task to install Server Diagnostics Mac OS X on a portable storage device, you can use any computer you have administrator access to. Installing Server Diagnostics Mac OS X involves three steps:  Install Mac OS X.  Copy Server Diagnostics Mac OS X to /Applications/.  Configure Mac OS X. To install Server Diagnostics Mac OS X: 1 Use Disk Utility to set up an empty volume with a partition map scheme of GUID Partition Table and at least 10 GB. For information about using Disk Utility, see Disk Utility Help. 2 Install Mac OS X on the empty volume. 3 Enable the root user. For information about enabling the root user, see “Enabling and using the root user in Mac OS X” at support.apple.com/kb/ht1528. 4 Log in using the root user name and the password of the user you created in the setup assistant. You must set up and run Server Diagnostics Mac OS X as root. Otherwise, you can’t test the server you’ve installed Server Diagnostics Mac OS X on. 5 Copy the AppleServerDiagnostics.app file to the /Applications/ folder on the server. 6 If you’re setting up a client server, open a Finder window, select the /Applications/ folder, choose New Folder from the Action (gear) pop-up menu, and name the folder AppleServerDiagnosticsClient. Client servers are remotely controlled by host computers. 7 Open System Preferences (located in /Applications/) and change the following options in System Preferences panes. 8 Chapter 2 InstallationChapter 2 Installation 9 System Preferences pane Recommended configuration Users & Groups Select the System Administrator account and click Login Items. Click Add (+), select AppleServerDiagnostics.app (typically located in /Applications/), and click Add. CDs & DVDs In all pop-up menus, choose Ignore. Desktop & Screen Saver In the Screen Saver pane, drag the “Start screen saver” slider to Never. Energy Saver In the Sleep pane, drag both sliders to Never and deselect “Put hard disk(s) to sleep when possible.” Mission Control In all pop-up menus, choose “–.” Software Update In the Scheduled Check pane, deselect “Check for updates.” If you can’t change settings in System Preferences, click the lock button and authenticate. Set up a NetBoot server To host Server Diagnostics EFI on a NetBoot server, your NetBoot server must:  Have Mac OS X v10.7 with server components installed.  Be on the same subnet as the server being tested.  Have 100 MB of hard disk space available for a Server Diagnostics NetBoot image. To use the Server Diagnostics NetBoot image: 1 On the server that hosts NetBoot, open AppleServerDiagnosticsNetBoot.pkg and follow the onscreen instructions to install the Server Diagnostics NetBoot image. 2 Configure the NetBoot service to serve the image and start the service. For information about configuring and starting NetBoot, see Server Admin Help.10 This chapter describes how to start up and use Server Diagnostics. Before you start up Server Diagnostics, make sure everything is properly installed and configured. For information, see Chapter 2,“Installation.” Change the startup disk Server Diagnostics is usually installed on a dedicated volume to minimize the risk of server processes interrupting the tests. Because of this, you must change the startup disk to the volume with Server Diagnostics installed before you can use the tools. To start up Server Diagnostics, set the startup volume of the server to the volume or disk image containing Server Diagnostics. You can change the startup disk in the Startup Disk pane of System Preferences. For information about how to change the startup disk in System Preferences, see System Preferences Help. You can also temporarily change the startup disk by holding down a key while starting up the server: Goal Hold down this key at server startup Choose the Server Diagnostics volume before starting up Mac OS X Option Start up the preinstalled Server Diagnostics EFI D Start up using a Server Diagnostics EFI disk image from the Internet Command and D Start up using the Server Diagnostics EFI disk image from a NetBoot server F1 If a firmware password is enabled and you try to temporarily change the startup volume by holding down the Option key at startup, you must authenticate. 3 Use Server DiagnosticsChapter 3 Use Server Diagnostics 11 The Startup Disk pane of System Preferences can start up Server Diagnostics Mac OS X, but not Server Diagnostics EFI. You can press the Option key at startup to start up Server Diagnostics Mac OS X or Server Diagnostics EFI. The server becomes unavailable when you use Server Diagnostics. Before starting tests, alert users that the server will be unavailable. About Server Diagnostics modes Server Diagnostics can start up in any of three modes: Mode Description Automatically enters mode if Host The computer searches for servers that are on the same subnet and start Server Diagnostics in remote mode. When one is found, the host computer controls Server Diagnostics on the client server. You run Server Diagnostics Mac OS X and you’re not logged in as root. Client The server can be controlled by a host computer. You’re running Server Diagnostics EFI and a host computer is on the same subnet or is directly connected. Local The server runs all tests locally. You’re running Server Diagnostics EFI, a host computer isn’t on the same subnet, and it isn’t directly connected. If you’re logged in as root on the server and you run Server Diagnostics Mac OS X, you can choose which mode to enter. Remotely test a client server To test a client server, start up Server Diagnostics on the host computer, set it to connect to the client server, start up the Server Diagnostics on the client server, and then set the client server to be a client of the host computer. The host computer must run Server Diagnostics Mac OS X. The client server can run Server Diagnostics Mac OS X or Server Diagnostics EFI. The available tests are based on which Server Diagnostics the client server is running. When you start up Server Diagnostics EFI, the server looks for a host computer. If it finds a host computer, the server enters client mode. If it doesn’t find a host computer, the server enters local mode.When you start up Server Diagnostics Mac OS X, the server automatically becomes a host computer if you logged in to Mac OS X with an account that isn’t root. If Server Diagnostics Mac OS X doesn’t automatically become a host computer, it asks if it should connect to a client server, be a client of a host computer, or run tests locally. To remotely test a client server: 1 On the host computer, open Server Diagnostics Mac OS X (typically located in /Applications/). 2 Choose from the following:  If you’re logged in as root, when Server Diagnostics Mac OS X opens, a dialog asks you to choose which mode to enter. Choose “Connect to remote server” and click OK.  If you’re not logged in as root, the dialog doesn’t appear, and Server Diagnostics Mac OS X automatically enters host mode. 3 On the client server, change the startup disk to a volume with Server Diagnostics and restart it. You can also temporarily change the startup disk to be a volume with Server Diagnostics on it or to a Server Diagnostics NetBoot disk image when you start up the server. For information about how to change or temporarily change the startup volume, see “Change the startup disk” on page 10. 4 If you’re starting up Server Diagnostics Mac OS X, log in as root. 5 If Server Diagnostics Mac OS X doesn’t open automatically, open the Apple Server Diagnostics application (typically located in /Applications/), choose “Client of a remote host,” and then click OK. If you’re starting up Server Diagnostics EFI, the server enters client mode. 6 Verify that the host computer and client server have established a successful connection by reviewing the following:  The IP address field in the Server Diagnostics window on the host computer should match the IP address assigned to the client server.  The name of the Server Diagnostics window on the host computer is “Apple Server Diagnostics remote log,” not “Apple Server Diagnostics local log.”  The log area of the client server uses more of the Server Diagnostics window. Shut Down, Restart, and a few other buttons are removed. 12 Chapter 3 Use Server DiagnosticsChapter 3 Use Server Diagnostics 13 Test the local server using Server Diagnostics EFI To test the local server, make sure none of the computers on the same subnet as the server running Server Diagnostics Mac OS X is in host mode. If a computer on the same subnet is running Server Diagnostics Mac OS X tools in host mode, the server enters client mode. To test the local server using Server Diagnostics EFI: m Restart the server and hold down the Option or F1 key to start up the volume or NetBoot disk image with Server Diagnostics EFI. For information about how to temporarily change the startup volume while starting the computer, see “Change the startup disk” on page 10. If Server Diagnostics EFI starts up and doesn’t find a host computer, it enters local mode. Test the local server using Server Diagnostics Mac OS X To test the local server, you must log in as root. If you don’t log in as root, Server Diagnostics Mac OS X enters host mode. To test the local server using Server Diagnostics Mac OS X: 1 Change the startup disk of the server to a volume with Server Diagnostics Mac OS X, restart it, and log in as root. 2 If Server Diagnostics Mac OS X doesn’t open, open it (typically located in /Applications/). 3 When Server Diagnostics Mac OS X opens, choose “Local” from the dialog that appears and click OK.Use Server Diagnostics EFI When Server Diagnostics EFI loads, the following screen appears: 3. Click to start testing. 2. Set test options. 1. Select tests to run. 4. View test results. Use Server Diagnostics Mac OS X When Server Diagnostics Mac OS X loads, the following screen appears: 3. Click to start testing. 2. Set test options. 1. Select tests to run. 4. View test results. 14 Chapter 3 Use Server Diagnostics PackageMaker User GuideContents Introduction to PackageMaker User Guide 4 Organization of This Document 4 See Also 5 Packaging Overview 6 Packaging Workflow 9 Create a PackageMaker Project 10 Identify the Product Components 10 Configure Component Packages 11 Component Package Configuration Pane 11 Component Package Contents Pane 13 Component Package Components Pane 14 Component Package Scripts Pane 15 Configure the Product Package 16 Product Package Configuration Pane 16 Product Package Requirements Pane 17 Product Package Actions Pane 18 Configure the Product Package Install Choices 18 Build the Product Package 20 Glossary 22 Document Revision History 24 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 2Figures and Tables Packaging Overview 6 Figure 1-1 The packaging process 7 Packaging Workflow 9 Figure 2-1 PackageMaker project window 9 Figure 2-2 Install Properties dialog 10 Figure 2-3 Component Package Configuration pane 11 Figure 2-4 Component Package Contents pane 13 Figure 2-5 Component Package Components pane 14 Figure 2-6 Component Package Scripts pane 15 Figure 2-7 Product Package Configuration pane 16 Figure 2-8 Product Package Requirements pane 17 Figure 2-9 Product Package Actions pane 18 Figure 2-10 Choice Configuration pane 19 Figure 2-11 Choice requirement editor 20 Table 2-1 Product package installation requirement examples 17 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 3Software packaging is the process used to put a software product into an installation package so that it can be installed by the users of the product on their computers. To package a product you use the PackageMaker application, which is part of the Xcode developer software suite. This document shows how to use PackageMaker to create installation packages. People who take finished product files and create installation packages for them are known as packagers. With PackageMaker, packagers accomplish these objectives: ● Enclose a software product in a transport-agnostic container for delivery to users ● Define the user install experience ● Specify how product files are placed on the user’s file system Software requirements: This document focuses on PackageMaker 3.0, introduced in Xcode 3.0. Most of the descriptions in this document do not apply to earlier releases of PackageMaker. You should read this document if you have a software product that you want to deliver to its users in a way that allows you to define certain aspects of the user install experience and details about how the product files are to be placed on the user’s file system. To get the most out of this document, you should be familiar with Software Delivery Guide , which describes the software delivery model used in OS X. Organization of This Document This document contains the following chapters: ● “Packaging Overview” (page 6). Describes briefly the packaging process in the context of the OS X software delivery model. ● “Packaging Workflow” (page 9). Explains the workflow you should follow when creating installation packages. This document also contains a glossary and a revision history. 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 4 Introduction to PackageMaker User GuideSee Also ● Software Delivery Guide . Explains how to deliver and installsoftware using the PackageMaker and Installer applications. Provides a larger picture of the OS X software-delivery model and more detailed information about the installation process. ● File System Overview. Conceptual information and guidelines describing the structure and usage of the OS X file system. Containsinformation about the OS X file system domains and the recommended locations for software components according to their type. Introduction to PackageMaker User Guide See Also 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 5Packaging is one of the processes that make up the OS X software-delivery model. An installation package is a file package that contains product files (the payload), instructions on how to add them to an OS X–based system, and information used to create an appropriate install experience for the user. When users open your installation package, the Installer application guides them through the installation process, which ensures that their computer meets the installation requirements defined in the package before placing the payload on the user’s file system, among other tasks. The preferred software delivery mechanism for a self-contained application is the manual install, where users drag the product from its container, a disk image, onto their file system. The installation package–based mechanism is the preferred method for delivering a multicomponent product that isn't self-contained in a bundle. A managed install, which is steered by the Installer application after the user opens an installation package, can take advantage of advanced features such as better package management through the Installer package database, downloadable packages, and certificate-based signing. OS X leverages these features to provide users an improved install experience. There are two types of installation packages: product packages and component packages. Product packages contain the payload for an entire product, either as a single component or distributed among several component packages. Component packages enclose a single component of a product and are generally contained within product packages. In addition, product packages can refer to external component packages through package references. 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 6 Packaging OverviewPackageMaker is the application you use to create installation packages. Figure 1-1 shows the packaging process within the software development-packaging-delivery-installation workflow. The rest of this document focuses on the packaging process. Figure 1-1 The packaging process Installation Delivery Packaging Menu • Option 1 • Option 2 • Option 3 Development To package a product: 1. Identify and collect the product’s components 2. Create a PackageMaker project 3. Add the product’s components to the project 4. Configure component packages Packaging Overview 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 75. Configure the product package 6. Define install options (in multicomponent products) 7. Build and test the product package “Packaging Workflow” (page 9) describes the packaging workflow in detail. Packaging Overview 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 8PackageMaker is used to create installation packages. Download the DeveloperUtilities app from http://developer.apple.com/downloads. Figure 2-1 shows the PackageMaker project window. The list following the figure describes the items identified in it. Figure 2-1 PackageMaker project window Product package Install option Component Action Add contents Product-package editor ● The left side of the window contains the package list. The first item in the list represents the product package the project generates. The items in the Contents pane represent component packages and, in product packages with more than one component package, install choices (the items with a blue dot next to them). ● The right side of the project window contains an editor for the item selected in the package list. Figure 2-1 shows the product-package editor. ● The plus sign (+) icon at the bottom-left corner of the window is the Add Contents button. 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 9 Packaging Workflow● The gear icon is the Action pop-up menu (also known as the shortcut menu). Its contents correspond to possible actions on the selected item. The following sections depict the workflow you should follow when creating installation packages. Create a PackageMaker Project A PackageMaker project is where you identify a product to be packaged and define the install experience for the users of the product. To create a PackageMaker project, choose: PackageMaker menu bar: File > New. PackageMaker displays the Install Properties dialog, shown in Figure 2-2. Figure 2-2 Install Properties dialog In this dialog you specify the following package properties: ● Provider Identifier (Organization): Identifies the entity responsible for the package’s contents. PackageMaker uses the provider identifier to generate default package identifiers for the contained component packages. See “Component Package Configuration Pane” (page 11). ● Target OS (Minimum Target): The earliest OS X release on which you intend the package to be installed. Identify the Product Components To define the package’s payload, locate the product components to be included in the package and add them to the Contents pane in the project window. You can add components by dragging them from a Finder window or by choosing: Packaging Workflow Create a PackageMaker Project 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 10PackageMaker menu bar: Project > Add Contents. After adding a second component to a project, PackageMaker creates an install choice for each component you add to the project, unless you add it directly to an existing install choice. Configure Component Packages You configure a component package in the component package editor, which contains four panes: Configuration, Contents, Components, and Scripts. They are described in the following sections. Component Package Configuration Pane The Component Package Configuration pane (shown in Figure 2-3) is where you specify essential information about the component package and its install experience. The list following the figure describes the items it specifies. Figure 2-3 Component Package Configuration pane ● Component source (Install): Pathname to the component’s root directory. This is the location of the component’s files on your file system. These files make up the component package’s payload. ● Destination (To): Location in the target computer’s file system where the component is to be placed. ● Customdestination consent(Allow customlocation): Specifies whether the user installing the component package can specify a different destination. Packaging Workflow Configure Component Packages 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 11● Package identifier: String, in the form of a universal type identifier (UTI), that identifies the component package. For example, com.apple.iSpend.pkg. Install effect: The Installer application uses the package identifier to identify the component package in the Installer package database. ● Package version number: Positive integer that specifies the iteration of the component package. (This version number is not related to any versioning information specified in the payload.) Install effect: The Installer application uses the package version number, together with the package identifier, to determine whether to install the contained component as a new item in the target computer or to upgrade an existing copy of the component. ● Finalization action (Post-install): Action to require the user perform after the installation process is complete. The available actions are log-out, restart, and shutdown. Install effect: After the installation processisfinished, the Installer application displays a dialog indicating the action to be performed. When the user clicks the dialog’s default button, Installer carries out the action. ● Administrator-authentication requirement (Require admin authorization): Specifies whether the user must authenticate as an administrator of the computer before performing the install. This is needed when the user can install a product in one of the privileged file-system domains, such as the local domain (for example, /Applications). You don’t need to select this option when the user can install your package only on their home directory (see “Product Package Configuration Pane” (page 16) for more information). Install effect: The Installer application displays the OS X Authentication dialog. If the user who authenticatesis not an administrator of the computer, the installation process does not proceed. Packaging Workflow Configure Component Packages 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 12Component Package Contents Pane The Component Package Contents pane (shown in Figure 2-4) is where you specify the ownership and access permissions of each of the files that make up the component. Figure 2-4 Component Package Contents pane Ownership and access permissions: The files that the Installer application places on the target computer have the same ownership and access permissions as the payload’s files. Therefore, you must set up the owner and access permissions of component files appropriately before building the installation package; otherwise, users may have difficulty manipulating those files after they are installed or Installer may be unable to copy payloads to their destinations. In most cases, the owner should be root and the group admin. Also, PackageMaker can set the owner, group, and access permissions of the component files to those that work best in OS X, according to the component type. Packaging Workflow Configure Component Packages 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 13Component Package Components Pane The Component Package Components pane (shown in Figure 2-5)specifies whetherthe componentisrelocatable or downgradable. Figure 2-5 Component Package Components pane A relocatable component is one that may be moved by the user after it’sinstalled. For example, after installing an application into /Applications, a user with administrator privileges may move it to /Volumes/Family/Applications. When the user installs a relocatable component a second time on the same computer, the Installer application searches for the component’s existing files in additional locations in the file system, not just the location at which the component was installed, according to the Installer package database). In this pane you also specify whether a component can be downgraded. A downgradable component is one that can be replaced with an earlier version during an install. When the user reinstalls a earlier version of an existing downgradable component, Installer replaces component files that exist in both the payload and the target computer with the ones in the payload and deletes files that are not present in the payload. Packaging Workflow Configure Component Packages 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 14Important: A component’s downgradability is specified by the installation package that may downgrade the component, not by the installation package from which the component was installed. And none of this information is kept in the component itself. That is, if an early release of an installation package specifies one of its components as downgradable but a later release deemsthe same component as not downgradable, after the user installs the later package, they can still downgrade the component using the earlier package. Component Package Scripts Pane The Component Package Scripts pane (shown in Figure 2-6)specifiesinstall operations—which are implemented as executable files—to perform before (preinstall) or after (postinstall) the component is installed. Figure 2-6 Component Package Scripts pane Install effect: The Installer application executesthe specified install operation either at the beginning of the install or at the end of the install. But Installer also warns users that it’s about to execute unsecured code when they open the installation package. Note: Consider defining preinstall and postinstall actions on the product package (see “Product Package Actions Pane” (page 18)) instead of preinstall and postinstall operations in component packages. The latter are inherently less secure and cause the warning described earlier. Important: In OS X v10.5 clients, the only install operations available are preinstall and postinstall. For detailed information about install operations, see Software Delivery Guide . Packaging Workflow Configure Component Packages 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 15Configure the Product Package When you select the product package in the package list, the product package editor appears on the right side of the project window. In this editor you define the product’s packaging details and some installation information. The following sections describe the panes in the product-package editor. Product Package Configuration Pane The Product Package Configuration pane (shown in Figure 2-7) is where you enter information about the product package, such as its title and description. You can also add other product description files, such as the Welcome, Read Me, License, and Conclusion files (see Software Delivery Guide for details). Figure 2-7 Product Package Configuration pane This pane also lets you specify which type of install the user can perform on the product package: easy, custom, or both. In addition, you can specify the locations into which the user can install the product: any volume, the system volume, or the user’s home directory. Packaging Workflow Configure the Product Package 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 16Product Package Requirements Pane A package requirement is a test the Installer application performs at the beginning of the installation process. These requirements may be optional. Any unmet, non-optional package requirement prevents the installation process from continuing. Figure 2-8 shows the Product Package Requirements pane, where you specify these requirements. In this case, the package has two requirements, one required and one optional. Their definition and install effects are described in Table 2-1. Figure 2-8 Product Package Requirements pane Table 2-1 Product package installation requirement examples Description Required Pass if Install effect Preventsinstall unless destination volume has at least 2MB of free space. Disk space on target volume Yes true is at least 2MB Displays a warning when the computer has less than 512MB of RAM. Computer RAM is less than No false 512MB Packaging Workflow Configure the Product Package 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 17Product Package Actions Pane You may want to tell the Installer application to perform a particular action before or after the product package is installed. Installation actions let you specify such tasks. For example, you can instruct Installer to show the installed payload in a Finder window, as shown in Figure 2-9. Figure 2-9 Product Package Actions pane This postinstall action opens a Finder window displaying one of the installed product’s components. Configure the Product Package Install Choices When your product contains multiple components, it may be appropriate to let the user decide which components to install. For example, a particular user of your product may not want to install a documentation or example component. In this case, the user should be able to remove unwanted components from the install process. PackageMaker and the Installer application allow you to define install choices to accomplish such outcome. Install choices allow users of your product package to customize the install by selecting the components to be installed (unselected components are not installed). For example, if your product includes an application and a user guide as separate components, you may allow the user not to install the user guide by having the application and the user guide under separate choices. In the install customization pane (the Custom Install pane in the Installer application), the user selects the components to be installed. Packaging Workflow Configure the Product Package Install Choices 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 18Note: Install choices are not a mechanism by which installed components can be removed from a computer. You configure an install choice by selecting it in the Contents pane in the project window and setting values for its properties in the choice editor, which contains two panes: Configuration and Requirements. Figure 2-10 shows the Choice Configuration pane. Figure 2-10 Choice Configuration pane This pane lets you specify the following choice properties: ● Choice Name: The text the user sees in the install customization pane. ● Identifier: Identifies the choice within the package. ● Initial State: Specifies the value of three user-interface properties (selected, actionable, and visible) of the choice the first time the user arrives at the install customization pane: ● Selected: Specifies whether the choice is selected. ● Enabled: Specifies whether the user can change the selected state of the choice directly. ● Hidden: Specifies whether the user can see the choice. ● Destination (Custom Location): Specifies the destination of the choice’s components. Defining a choice destination overrides the destination specified for the choice’s components in the component package editor (see “Component Package Configuration Pane” (page 11)). You may also allow the user to choose a different destination by selecting “Allow alternate volume.“ You should always specify a destination for every choice with product components. Packaging Workflow Configure the Product Package Install Choices 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 19● Tooltip: Short message (15 words or fewer) that appears when the user hovers the pointer over the choice in the install customization pane. ● Description: Information that appears in the install customization pane when the user selects the choice. As described earlier, a choice has user-interface properties that define the level of interaction the user has with the choice in the install customization pane. While you can specify a value for each UI property in the package, there may be choices that need information about the computer to determine the value of such properties. For example, if an optional plug-in component can work only in certain releases of OS X, you may want to display the choice that contains the component only when the computer is running an appropriate operating system version. Here’s where choice requirements can help. A choice requirement is a test that compares a system property against a value and setsthe initial and dynamic values of the choice’s UI properties based on the test result. (The Installer application sets the dynamic values of the UI properties as the user selects or deselects choices in the install customization pane; see Software Delivery Guide for details.) Figure 2-11 shows the choice requirement editor, which lets you define the test and the resulting values of the choice UI properties if the test fails. Figure 2-11 Choice requirement editor Build the Product Package To build the package, choose: Packaging Workflow Build the Product Package 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 20PackageMaker menu bar: Project > Build. A dialog appears asking for the name and location of the package. Open the generated installation package in the Installer application and ensure that the resulting install experience is what you expect and that your product is installed correctly. You should perform comprehensive tests involving as many of the system configurations your product supports as possible. See Software Delivery Guide for more information. Packaging Workflow Build the Product Package 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 21choice requirement A test that comparesthe value of a system property (such as the amount of random-access memory available) with a value. Choice requirements determine the value of a choice’s user-interface properties: selected, actionable, and visible. choice requirement editor Area of a PackageMaker project window that allows packagers to specify a choice requirement (and how it affects the value of the choice’s user-interface properties). See also choice requirement. component package Installer package that contains a single software component asits payload. See also, product package. component package editor Area of a PackageMaker project window that specifies packaging and installation information about a product component. This editor is displayed when a component isselected in the Contents pane in the project window. downgradable component A product component, such as an application binary or a plug-in, that can be replaced with an earlier version in an install process. finalization action An action required after a completed installation process. The possible finalization actions are log-out, restart, and shutdown. install choice An option users can select or deselect during the installation process to specify whether a product component is to be installed install customization pane A pane users see while interacting with the Installer application if the package being installed allowsthe user to customize the install by choosing the product components to be installed. See also, product package, product component. install operation An install-time operation performed by an executable file that is invoked at the beginning or at the end of the install. The two install operations supported in OS X v10.5 are preinstall and postinstall. installation action A task to be performed before or after an install. PackageMaker defines several installation actions, including Quit Application and Show File in Finder. installation package A file package with the pkg or mpkg extension. Installation packages contain a payload and installation information used by the Installer or Remote Desktop applications to identify the payload’s parts and generate an install experience for the user. Installer package database System-level database of all the installation packages installed by the Installer application. managed install An Installer application–driven installation process. Users open an installer package in Installer, which then guides them through the installation process. 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 22 Glossarymanual install An user-driven installation process. In this software-installation method, users drag a product’sfilesto a location of their choosing in their computer’s file system. See also managed install. package identifier Identifies the package within the Installer package database. See also Installer package database. package list A pane in a PackageMaker project window that lists the packages the project defines. This list is divided in two parts: the installation-package file (which contains all the product’s files) and the subpackages or package referencesthat contain components of the product. package requirement A test that determines whether a package can be installed on the computer. A package requirement can be optional; such requirements display a warning to the user but allows the install to proceed. Non-optional requirements prevent an install from taking place. package version number Positive integer that identifies an iteration of a single-component product package, or an iteration of a component package within a product package. This version number should be incremented when the contents or installation details of the package are changed. See also product package component package. payload The product or product components contained in an installation package. See also installation package. product component Self-contained part of a product. A product can have one or more components. The OS X file system contains special locations for several types of components. For example, application binaries are placed in Application directories, plug-ins are housed in Plugin directories, fonts live in Fonts directories, and so on. product package Installation package that contains all the components of a product. Product packages with multicomponent products contain or reference component packages. See also installation package. product package editor A pane in a PackageMaker project window that specifies packaging and installation information about a product. This pane is displayed when the product package is selected in the package list. provider identifier Identifier for the entity responsible for the contents of an installation package; for example, com.apple. PackageMaker uses this identifier to generate default package identifiers for a product package’s components. See also package identifier. relocatable component A product component, such as an application binary or a plug-in, that the user may move after it has been installed. target OS version The earliest release of OS X in which the installation package isto be installed. The package is installable on the specified release and later. For example, a package whose target OS is OS X v10.4 can be installed on computers running OS X v10.4 and later releases. volume requirement A test that comparesthe value of a volume property (such as free space) with a value. Volume requirements determine whether the user can choose a particular volume as the destination volume of a product package. Glossary 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 23This table describes the changes to PackageMaker User Guide . Date Notes 2012-02-16 Updated download location. 2009-01-06 Made minor technical corrections. New document that describes how to use PackageMaker to create installation packages. 2007-07-23 2012-02-16 | © 2012 Apple Inc. All Rights Reserved. 24 Document Revision HistoryApple Inc. © 2012 Apple Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrievalsystem, or transmitted, in any form or by any means, mechanical, electronic, photocopying, recording, or otherwise, without prior written permission of Apple Inc., with the following exceptions: Any person is hereby authorized to store documentation on a single computer for personal use only and to print copies of documentation for personal use provided that the documentation contains Apple’s copyright notice. No licenses, express or implied, are granted with respect to any of the technology described in this document. Apple retains all intellectual property rights associated with the technology described in this document. This document is intended to assist application developers to develop applications only for Apple-labeled computers. Apple Inc. 1 Infinite Loop Cupertino, CA 95014 408-996-1010 Apple, the Apple logo, Finder, Mac, OS X, and Xcode are trademarks of Apple Inc., registered in the U.S. and other countries. Even though Apple has reviewed this document, APPLE MAKES NO WARRANTY OR REPRESENTATION, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THIS DOCUMENT, ITS QUALITY, ACCURACY, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.ASARESULT, THISDOCUMENT IS PROVIDED “AS IS,” AND YOU, THE READER, ARE ASSUMING THE ENTIRE RISK AS TO ITS QUALITY AND ACCURACY. IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL,OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT OR INACCURACY IN THIS DOCUMENT, even if advised of the possibility of such damages. THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORAL OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer, agent, or employee is authorized to make any modification, extension, or addition to this warranty. Some states do not allow the exclusion or limitation of implied warranties or liability for incidental or consequential damages, so the above limitation or exclusion may not apply to you. This warranty gives you specific legal rights, and you may also have other rights which vary from state to state. iOS Security May 20122 Page 3 Introduction Page 4 System Architecture Secure Boot Chain System Software Personalization App Code Signing Runtime Process Security Page 7 Encryption and Data Protection Hardware Security Features File Data Protection Passcodes Classes Keychain Data Protection Keybags Page 13 Network Security SSL, TLS VPN Wi-Fi Bluetooth Page 15 Device Access Passcode Protection Configuration Enforcement Mobile Device Management Device Restrictions Remote Wipe Page 18 Conclusion A Commitment to Security Page 19 Glossary ContentsApple designed the iOS platform with security at its core. Keeping information secure on mobile devices is critical for any user, whether they’re accessing corporate and customer information or storing personal photos, banking information, and addresses. Because every user’s information is important, iOS devices are built to maintain a high level of security without compromising the user experience. iOS devices provide stringent security technology and features, and yet also are easy to use. The devices are designed to make security as transparent as possible. Many security features are enabled by default, so IT departments don’t need to perform extensive configurations. And some key features, like device encryption, are not configurable, so users cannot disable them by mistake. For organizations considering the security of iOS devices, it is helpful to understand how the built-in security features work together to provide a secure mobile computing platform. iPhone, iPad, and iPod touch are designed with layers of security. Low-level hardware and firmware features protect against malware and viruses, while high-level OS features allow secure access to personal information and corporate data, prevent unauthorized use, and help thwart attacks. The iOS security model protects information while still enabling mobile use, third-party apps, and syncing. Much of the system is based on industry-standard secure design principles—and in many cases, Apple has done additional design work to enhance security without compromising usability. This document provides details about how security technology and features are implemented within the iOS platform. It also outlines key elements that organizations should understand when evaluating or deploying iOS devices on their networks. • System architecture: The secure platform and hardware foundations of iPhone, iPad, and iPod touch. • Encryption and Data Protection: The architecture and design that protects the user’s data when the device is lost or stolen, or when an unauthorized person attempts to use or modify it. • Network security: Industry-standard networking protocols that provide secure authentication and encryption of data in transmission. • Device access: Methods that prevent unauthorized use of the device and enable it to be remotely wiped if lost or stolen. iOS is based on the same core technologies as OS X, and benefits from years of hardening and security development. The continued enhancements and additional security features with each major release of iOS have allowed IT departments in businesses worldwide to rapidly adopt and support iOS devices on their networks. Device Key Group Key Apple Root Certificate Crypto Engine Kernel OS Partition User Partition Data Protection Class App Sandbox Encrypted File System Software Hardware and Firmware Introduction 3 Security architecture diagram of iOS provides a visual overview of the different technologies discussed in this document.Entering DFU mode DFU mode can be entered manually by connecting the device to a computer using the 30-pin Dock Connector to USB Cable, then holding down both the Home and Sleep/Wake buttons. After 8 seconds have elapsed, release the Sleep/Wake button while continuing to hold down the Home button. Note: Nothing will be displayed on the screen when in DFU mode. If the Apple logo appears, the Sleep/Wake button was held down for too long. Restoring a device after entering DFU mode returns it to a known good state with the certainty that only unmodified Applesigned code is present. 4 The tight integration of hardware and software on iOS devices allows for the validation of activities across all layers of the device. From initial boot-up to iOS software installation and through to third-party apps, each step is analyzed and vetted to ensure that each activity is trusted and uses resources properly. Once the system is running, this integrated security architecture depends on the integrity and trustworthiness of XNU, the iOS kernel. XNU enforces security features at runtime and is essential to being able to trust higher-level functions and apps. Secure Boot Chain Each step of the boot-up process contains components that are cryptographically signed by Apple to ensure integrity, and proceeds only after verifying the chain of trust. This includes the bootloaders, kernel, kernel extensions, and baseband firmware. When an iOS device is turned on, its application processor immediately executes code from read-only memory known as the Boot ROM. This immutable code is laid down during chip fabrication, and is implicitly trusted. The Boot ROM code contains the Apple Root CA public key, which is used to verify that the Low-Level Bootloader (LLB) is signed by Apple before allowing it to load. This is the first step in the chain of trust where each step ensures that the next is signed by Apple. When the LLB finishes its tasks, it verifies and runs the next-stage bootloader, iBoot, which in turn verifies and runs the iOS kernel. This secure boot chain ensures that the lowest levels of software are not tampered with, and allows iOS to run only on validated Apple devices. If one step of this boot process is unable to load or verify the next, boot-up is stopped and the device displays the “Connect to iTunes” screen. This is called recovery mode. If the Boot ROM is not even able to load or verify LLB, it enters DFU (Device Firmware Upgrade) mode. In both cases, the device must be connected to iTunes via USB and restored to factory default settings. For more information on manually entering recovery mode, see http://support.apple.com/kb/HT1808. System Software Personalization Apple regularly releases software updates to address emerging security concerns; these updates are provided for all supported devices simultaneously. Users receive iOS update notifications on the device and through iTunes, and updates are delivered wirelessly, encouraging rapid adoption of the latest security fixes. The boot process described above ensures that only Apple-signed code can be installed on a device. To prevent devices from being downgraded to older versions that lack the latest security updates, iOS uses a process called System Software Personalization. If downgrades were possible, an attacker who gains possession of a device could install an older version of iOS and exploit a vulnerability that’s been fixed in the newer version. System Architecture5 iOS software updates can be installed using iTunes or over-the-air (OTA) on the device. With iTunes, a full copy of iOS is downloaded and installed. OTA software updates are provided as deltas for network efficiency. During an iOS install or upgrade, iTunes (or the device itself, in the case of OTA software updates) connects to the Apple installation authorization server (gs.apple.com) and sends it a list of cryptographic measurements for each part of the installation bundle to be installed (for example LLB, iBoot, the kernel, and OS image), a random anti-replay value (nonce), and the device’s unique ID (ECID). The server checks the presented list of measurements against versions for which installation is permitted, and if a match is found, adds the ECID to the measurement and signs the result. The complete set of signed data from the server is passed to the device as part of the install or upgrade process. Adding the ECID “personalizes” the authorization for the requesting device. By authorizing and signing only for known measurements, the server ensures that the update is exactly as provided by Apple. The boot-time chain-of-trust evaluation verifies that the signature comes from Apple and that the measurement of the item loaded from disk, combined with the device’s ECID, matches what was covered by the signature. These steps ensure that the authorization is for a specific device and that an old iOS version from one device can’t be copied to another. The nonce prevents an attacker from saving the server’s response and using it to downgrade a user’s device in the future. App Code Signing Once the iOS kernel has booted, it controls which user processes and apps can be run. To ensure that all apps come from a known and approved source and have not been tampered with, iOS requires that all executable code be signed using an Apple-issued certificate. Apps provided with the device, like Mail and Safari, are signed by Apple. Third-party apps must also be validated and signed using an Apple-issued certificate. Mandatory code signing extends the concept of chain of trust from the OS to apps, and prevents third-party apps from loading unsigned code resources or using selfmodifying code. In order to develop and install apps on iOS devices, developers must register with Apple and join the iOS Developer Program. The real-world identity of each developer, whether an individual or a business, is verified by Apple before their certificate is issued. This certificate enables developers to sign apps and submit them to the App Store for distribution. As a result, all apps in the App Store have been submitted by an identifiable person or organization, serving as a deterrent to the creation of malicious apps. They have also been reviewed by Apple to ensure they operate as described and don’t contain obvious bugs or other problems. In addition to the technology already discussed, this curation process gives customers confidence in the quality of the apps they buy. Businesses also have the ability to write in-house apps for use within their organization and distribute them to their employees. Businesses and organizations can apply to the iOS Developer Enterprise Program (iDEP) with a D-U-N-S number. Apple approves applicants after verifying their identity and eligibility. Once an organization becomes a member of iDEP, it can register to obtain a provisioning profile that permits in-house apps to run on devices it authorizes. Users must have the provisioning profile installed in order to run the in-house apps. This ensures that only the organization’s intended users are able to load the apps onto their iOS devices.6 Unlike other mobile platforms, iOS does not allow users to install potentially malicious unsigned apps from websites, or run untrusted code. At runtime, code signature checks of all executable memory pages are made as they are loaded to ensure that an app has not been modified since it was installed or last updated. Runtime Process Security Once an app is verified to be from an approved source, iOS enforces security measures to ensure that it can’t compromise other apps or the rest of the system. All third-party apps are “sandboxed,” so they are restricted from accessing files stored by other apps or from making changes to the device. This prevents apps from gathering or modifying information stored by other apps. Each app has a unique home directory for its files, which is randomly assigned when the app is installed. If a third-party app needs to access information other than its own, it does so only by using application programming interfaces (APIs) and services provided by iOS. System files and resources are also shielded from the user’s apps. The majority of iOS runs as the non-privileged user “mobile,” as do all third-party apps. The entire OS partition is mounted read-only. Unnecessary tools, such as remote login services, aren’t included in the system software, and APIs do not allow apps to escalate their own privileges to modify other apps or iOS itself. Access by third-party apps to user information and features such as iCloud is controlled using declared entitlements. Entitlements are key/value pairs that are signed in to an app and allow authentication beyond runtime factors like unix user ID. Since entitlements are digitally signed, they cannot be changed. Entitlements are used extensively by system apps and daemons to perform specific privileged operations that would otherwise require the process to run as root. This greatly reduces the potential for privilege escalation by a compromised system application or daemon. In addition, apps can only perform background processing through system-provided APIs. This enables apps to continue to function without degrading performance or dramatically impacting battery life. Apps can’t share data directly with each other; sharing can be implemented only by both the receiving and sending apps using custom URL schemes, or through shared keychain access groups. Address space layout randomization (ASLR) protects against the exploitation of memory corruption bugs. Built-in apps use ASLR to ensure that all memory regions are randomized upon launch. Additionally, system shared library locations are randomized at each device startup. Xcode, the iOS development environment, automatically compiles third-party programs with ASLR support turned on. Further protection is provided by iOS using ARM’s Execute Never (XN) feature, which marks memory pages as non-executable. Memory pages marked as both writable and executable can be used only by apps under tightly controlled conditions: The kernel checks for the presence of the Apple-only “dynamic-codesigning” entitlement. Even then, only a single mmap call can be made to request an executable and writable page, which is given a randomized address. Safari uses this functionality for its JavaScript JIT compiler.7 The secure boot chain, code signing, and runtime process security all help to ensure that only trusted code and apps can run on a device. iOS has additional security features to protect user data, even in cases where other parts of the security infrastructure have been compromised (for example, on a device with unauthorized modifications). Like the system architecture itself, these encryption and data protection capabilities use layers of integrated hardware and software technologies. Hardware Security Features On mobile devices, speed and power efficiency are critical. Cryptographic operations are complex and can introduce performance or battery life problems if not designed and implemented correctly. Every iOS device has a dedicated AES 256 crypto engine built into the DMA path between the flash storage and main system memory, making file encryption highly efficient. Along with the AES engine, SHA-1 is implemented in hardware, further reducing cryptographic operation overhead. The device’s unique ID (UID) and a device group ID (GID) are AES 256-bit keys fused into the application processor during manufacturing. No software or firmware can read them directly; they can see only the results of encryption or decryption operations performed using them. The UID is unique to each device and is not recorded by Apple or any of its suppliers. The GID is common to all processors in a class of devices (for example, all devices using the Apple A5 chip), and is used as an additional level of protection when delivering system software during installation and restore. Burning these keys into the silicon prevents them from being tampered with or bypassed, and guarantees that they can be accessed only by the AES engine. The UID allows data to be cryptographically tied to a particular device. For example, the key hierarchy protecting the file system includes the UID, so if the memory chips are physically moved from one device to another, the files are inaccessible. The UID is not related to any other identifier on the device. Apart from the UID and GID, all other cryptographic keys are created by the system’s random number generator (RNG) using an algorithm based on Yarrow. System entropy is gathered from interrupt timing during boot, and additionally from internal sensors once the device has booted. Securely erasing saved keys is just as important as generating them. It’s especially challenging to do so on flash storage, where wear-leveling might mean multiple copies of data need to be erased. To address this issue, iOS devices include a feature dedicated to secure data erasure called Effaceable Storage. This feature accesses the underlying storage technology (for example, NAND) to directly address and erase a small number of blocks at a very low level. Encryption and Data ProtectionErase all content and settings The “Erase all content and settings” option in Settings obliterates all the keys in Effaceable Storage, rendering all user data on the device cryptographically inaccessible. Therefore, it’s an ideal way to be sure all personal information is removed from a device before giving it to somebody else or returning it for service. Important: Do not use the “Erase all content and settings” option until the device has been backed up, as there is no way to recover the erased data. 8 File Data Protection In addition to the hardware encryption features built into iOS devices, Apple uses a technology called Data Protection to further protect data stored in flash memory on the device. This technology is designed with mobile devices in mind, taking into account the fact that they may always be turned on and connected to the Internet, and may receive phone calls, text, or emails at any time. Data Protection allows a device to respond to events such as incoming phone calls without decrypting sensitive data and downloading new information while locked. These individual behaviors are controlled on a per-file basis by assigning each file to a class, as described in the Classes section later in document. Data Protection protects the data in each class based on when the data needs to be accessed. Accessibility is determined by whether the class keys have been unlocked. Data Protection is implemented by constructing and managing a hierarchy of keys, and builds on the hardware encryption technologies previously described. Architecture overview Every time a file on the data partition is created, Data Protection creates a new 256-bit key (the “per-file” key) and gives it to the hardware AES engine, which uses the key to encrypt the file as it is written to flash memory using AES CBC mode. The initialization vector (IV) is the output of a linear feedback shift register (LFSR) calculated with the block offset into the file, encrypted with the SHA-1 hash of the per-file key. The per-file key is wrapped with one of several class keys, depending on the circumstances under which the file should be accessible. Like all other wrappings, this is performed using NIST AES key wrapping, per RFC 3394. The wrapped per-file key is stored in the file’s metadata. When a file is opened, its metadata is decrypted with the file system key, revealing the wrapped per-file key and a notation on which class protects it. The per-file key is unwrapped with the class key, then supplied to the hardware AES engine, which decrypts the file as it is read from flash memory. The metadata of all files in the file system are encrypted with a random key, which is created when iOS is first installed or when the device is wiped by a user. The file system key is stored in Effaceable Storage. Since it’s stored on the device, this key is not used to maintain the confidentiality of data; instead, it’s designed to be quickly erased on demand (by the user, with the “Erase all content and settings” option, or by a user or administrator issuing a remote wipe command from a Mobile Device Management server, Exchange ActiveSync, or iCloud). Erasing the key in this manner renders all files cryptographically inaccessible.Passcode considerations If a long password that contains only numbers is entered, a numeric keypad is displayed at the Lock screen instead of the full keyboard. A longer numeric passcode may be easier to enter than a shorter alphanumeric passcode, while providing similar security. Creating strong Apple ID passwords Apple IDs are used to connect to a number of services including iCloud, FaceTime, and iMessage. To help users create strong passwords, all new accounts must contain the following password attributes: • At least eight characters • At least one letter • At least one uppercase letter • At least one number • No more than three consecutive identical characters • Not the same as the account name 9 File Contents File Metadata File Key File System Key Class Key User Passcode Device UID The content of a file is encrypted with a per-file key, which is wrapped with a class key and stored in a file’s metadata, which is in turn encrypted with the file system key. The class key is protected with the hardware UID and, for some classes, the user’s passcode. This hierarchy provides both flexibility and performance. For example, changing a file’s class only requires rewrapping its per-file key, and a change of passcode just rewraps the class key. Passcodes By setting up a device passcode, the user automatically enables Data Protection. iOS supports four-digit and arbitrary-length alphanumeric passcodes. In addition to unlocking the device, a passcode provides the entropy for encryption keys, which are not stored on the device. This means an attacker in possession of a device can’t get access to data in certain protection classes without the passcode. The passcode is “tangled” with the device’s UID, so brute-force attempts must be performed on the device under attack. A large iteration count is used to make each attempt slower. The iteration count is calibrated so that one attempt takes approximately 80 milliseconds. This means it would take more than 5½ years to try all combinations of a six-character alphanumeric passcode with lowercase letters and numbers, or 2½ years for a nine-digit passcode with numbers only. To further discourage brute-force passcode attacks, the iOS interface enforces escalating time delays after the entry of an invalid passcode at the Lock screen. Users can choose to have the device automatically wiped after 10 failed passcode attempts. This setting is also available as an administrative policy through Mobile Device Management (MDM) and Exchange ActiveSync, and can also be set to a lower threshold.10 Classes When a new file is created on an iOS device, it’s assigned a class by the app that creates it. Each class uses different policies to determine when the data is accessible. The basic classes and policies are as follows: Complete Protection (NSFileProtectionComplete): The class key is protected with a key derived from the user passcode and the device UID. Shortly after the user locks a device (10 seconds, if the Require Password setting is Immediately), the decrypted class key is discarded, rendering all data in this class inaccessible until the user enters the passcode again. The Mail app implements Complete Protection for messages and attachments. App launch images and location data are also stored with Complete Protection. Protected Unless Open (NSFileProtectionCompleteUnlessOpen): Some files may need to be written while the device is locked. A good example of this is a mail attachment downloading in the background. This behavior is achieved by using asymmetric elliptic curve cryptography (ECDH over Curve25519). Along with the usual per-file key, Data Protection generates a file public/private key pair. A shared secret is computed using the file’s private key and the Protected Unless Open class public key, whose corresponding private key is protected with the user’s passcode and the device UID. The per-file key is wrapped with the hash of this shared secret and stored in the file’s metadata along with the file’s public key; the corresponding private key is then wiped from memory. As soon as the file is closed, the per-file key is also wiped from memory. To open the file again, the shared secret is re-created using the Protected Unless Open class’s private key and the file’s ephemeral public key; its hash is used to unwrap the per-file key, which is then used to decrypt the file. Protected Until First User Authentication (NSFileProtectionCompleteUntilFirstUserAuthentication): This class behaves in the same way as Complete Protection, except that the decrypted class key is not removed from memory when the device is locked. The protection in this class has similar properties to desktop full-disk encryption, and protects data from attacks that involve a reboot. No Protection (NSFileProtectionNone): This class key is protected only with the UID, and is kept in Effaceable Storage. This is the default class for all files not otherwise assigned to a Data Protection class. Since all the keys needed to decrypt files in this class are stored on the device, the encryption only affords the benefit of fast remote wipe. If a file is not assigned a Data Protection class, it is still stored in encrypted form (as is all data on an iOS device). The iOS Software Development Kit (SDK) offers a full suite of APIs that make it easy for third-party and in-house developers to adopt Data Protection and ensure the highest level of protection in their apps. Data Protection is available for file and database APIs, including NSFileManager, CoreData, NSData, and SQLite.Components of a keychain item Along with the access group, each keychain item contains administrative metadata (such as “created” and “last updated” time stamps). It also contains SHA-1 hashes of the attributes used to query for the item (such as the account and server name) to allow lookup without decrypting each item. And finally, it contains the encryption data, which includes the following: • Version number • Value indicating which protection class the item is in • Per-item key wrapped with the protection class key • Dictionary of attributes describing the item (as passed to SecItemAdd), encoded as a binary plist and encrypted with the per-item key The encryption is AES 128 in GCM (Galois/ Counter Mode); the access group is included in the attributes and protected by the GMAC tag calculated during encryption. 11 Keychain Data Protection Many apps need to handle passwords and other short but sensitive bits of data, such as keys and login tokens. The iOS keychain provides a secure way to store these items. The keychain is implemented as a SQLite database stored on the file system in the No Protection class, while its security is provided by a different key hierarchy that runs parallel to the key hierarchy used to protect files. There is only one database; the securityd daemon determines which keychain items each process or app can access. Keychain access APIs result in calls to the securityd framework, which queries the app’s “keychain-access-groups” and the “application-identifier” entitlement. Rather than limiting access to a single process, access groups allow keychain items to be shared between apps. Keychain items can only be shared between apps from the same developer. This is managed by requiring third-party apps to use access groups with a prefix allocated to them through the iOS Developer Program. The prefix requirement is enforced through code signing and provisioning profiles. Keychain data is protected using a class structure similar to the one used in file Data Protection. These classes have behaviors equivalent to file Data Protection classes, but use distinct keys and are part of APIs that are named differently. Availability File Data Protection Keychain Data Protection When unlocked NSFileProtectionComplete kSecAttrAccessibleWhenUnlocked While locked NSFileProtectionCompleteUnlessOpen N/A After first unlock NSFileProtectionCompleteUntilFirstUserAuthentication kSecAttrAccessibleAfterFirstUnlock Always NSFileProtectionNone kSecAttrAccessibleAlways Each keychain class has a “This device only” counterpart, which is always protected with the UID when being copied from the device during a backup, rendering it useless if restored to a different device. Apple has carefully balanced security and usability by choosing keychain classes that depend on the type of information being secured and when it’s needed by the OS. For example, a VPN certificate must always be available so the device keeps a continuous connection, but it’s classified as “non-migratory,” so it can’t be moved to another device. For keychain items created by iOS, the following class protections are enforced: Item Accessible Wi-Fi passwords After first unlock Mail accounts After first unlock Exchange accounts After first unlock VPN certificates Always, non-migratory VPN passwords After first unlock LDAP, CalDAV, CardDAV After first unlock iTunes backup When unlocked, non-migratory Voicemail Always Safari passwords When unlocked Bluetooth keys Always, non-migratory Apple Push Notification Service Token Always, non-migratory iCloud certificates and private key Always, non-migratory iMessage keys Always, non-migratory Certificates and private keys installed by Configuration Profile Always, non-migratory SIM PIN Always, non-migratoryComponents of a keybag A header containing: • Version (set to 3 in iOS 5) • Type (System, Backup, Escrow, or iCloud Backup) • Keybag UUID • An HMAC if the keybag is signed • The method used for wrapping the class keys: tangling with the UID or PBKDF2, along with the salt and iteration count A list of class keys: • Key UUID • Class (which file or keychain Data Protection class this is) • Wrapping type (UID-derived key only; UID-derived key and passcode-derived key) • Wrapped class key • Public key for asymmetric classes 12 Keybags The keys for both file and keychain Data Protection classes are collected and managed in keybags. iOS uses the following four keybags: System, Backup, Escrow, and iCloud Backup. System keybag is where the wrapped class keys used in normal operation of the device are stored. For example, when a passcode is entered, the NSFileProtectionComplete key is loaded from the system keychain and unwrapped. It is a binary plist stored in the No Protection class, but whose contents are encrypted with a key held in Effaceable Storage. In order to give forward security to keybags, this key is wiped and regenerated each time a user changes a passcode. The System keybag is the only keybag stored on the device. The AppleKeyStore kernel extension manages the System keybag, and can be queried regarding a device’s lock state. It reports that the device is unlocked only if all the class keys in the System are accessible, having been unwrapped successfully. Backup keybag is created when an encrypted backup is made by iTunes and stored on the computer to which the device is backed up. A new keybag is created with a new set of keys, and the backed-up data is re-encrypted to these new keys. As explained earlier, non-migratory keychain items remain wrapped with the UID-derived key, allowing them to be restored to the device they were originally backed up from, but rendering them inaccessible on a different device. The keybag is protected with the password set in iTunes, run through 10,000 iterations of PBKDF2. Despite this large iteration count, there’s no tie to a specific device, and therefore a brute-force attack parallelized across many computers can be attempted on the backup keybag. This threat can be mitigated with a sufficiently strong password. If a user chooses to not encrypt an iTunes backup, the backup files are not encrypted regardless of their Data Protection class, but the keychain remains protected with a UID-derived key. This is why keychain items migrate to a new device only if a backup password is set. Escrow keybag is used for iTunes syncing and Mobile Device Management (MDM). This keybag allows iTunes to back up and sync without requiring the user to enter a passcode, and it allows an MDM server to remotely clear a user’s passcode. It is stored on the computer that’s used to sync with iTunes, or on the MDM server that manages the device. The Escrow keybag improves the user experience during device synchronization, which potentially requires access to all classes of data. When a passcode-locked device is first connected to iTunes, the user is prompted to enter a passcode. The device then creates an Escrow keybag and passes it to the host. The Escrow keybag contains exactly the same class keys used on the device, protected by a newly generated key. This key is needed to unlock the Escrow keybag, and is stored on the device in the Protected Until First User Authentication class. This is why the device passcode must be entered before backing up with iTunes for the first time after a reboot. iCloud Backup keybag is similar to the Backup keybag. All the class keys in this keybag are asymmetric (using Curve25519, like the Protected Unless Open Data Protection class), so iCloud backups can be performed in the background. For all Data Protection classes except No Protection, the encrypted data is read from the device and sent to iCloud. The corresponding class keys are protected by iCloud keys. The keychain class keys are wrapped with a UID-derived key in the same way as an unencrypted iTunes backup. 13 In addition to the measures Apple has taken to protect data stored on iOS devices, there are many network security measures that organizations can take to safeguard information as it travels to and from an iOS device. Mobile users must be able to access corporate information networks from anywhere in the world, so it’s important to ensure they are authorized and that their data is protected during transmission. iOS uses—and provides developer access to—standard networking protocols for authenticated, authorized, and encrypted communications. iOS provides proven technologies and the latest standards to accomplish these security objectives for both Wi-Fi and cellular data network connections. On other platforms, firewall software is needed to protect numerous open communication ports against intrusion. Because iOS achieves a reduced attack surface by limiting listening ports and removing unnecessary network utilities such as telnet, shells, or a web server, it doesn’t need firewall software. Additionally, communication using iMessage, FaceTime, and the Apple Push Notification Server is fully encrypted and authenticated. SSL, TLS iOS supports Secure Socket Layer (SSL v3) as well as Transport Layer Security (TLS v1.1, TLS v1.2) and DTLS. Safari, Calendar, Mail, and other Internet applications automatically use these mechanisms to enable an encrypted communication channel between the device and network services. High-level APIs (such as CFNetwork) make it easy for developers to adopt TLS in their apps, while low-level APIs (SecureTransport) provide fine-grained control. VPN Secure network services like virtual private networking typically require minimal setup and configuration to work with iOS devices. iOS devices work with VPN servers that support the following protocols and authentication methods: • Juniper Networks, Cisco, Aruba Networks, SonicWALL, Check Point, and F5 Networks SSL-VPN using the appropriate client app from the App Store. These apps provide user authentication for the built-in iOS support. • Cisco IPSec with user authentication by Password, RSA SecurID or Cryptocard, and machine authentication by shared secret and certificates. Cisco IPSec supports VPN On Demand for domains that are specified during device configuration. • L2TP/IPSec with user authentication by MS-CHAPV2 Password, RSA SecurID or Cryptocard, and machine authentication by shared secret. • PPTP with user authentication by MS-CHAPV2 Password and RSA SecurID or Cryptocard. Network Security14 iOS supports VPN On Demand for networks that use certificated-based authentication. IT policies specify which domains require a VPN connection by using a configuration profile. For more information on VPN server configuration for iOS devices, see http://help.apple.com/iosdeployment-vpn/. Wi-Fi iOS supports industry-standard Wi-Fi protocols, including WPA2 Enterprise, to provide authenticated access to wireless corporate networks. WPA2 Enterprise uses 128-bit AES encryption, giving users the highest level of assurance that their data remains protected when sending and receiving communications over a Wi-Fi network connection. With support for 802.1X, iOS devices can be integrated into a broad range of RADIUS authentication environments. 802.1X wireless authentication methods supported on iPhone and iPad include EAP-TLS, EAP-TTLS, EAP-FAST, EAP-SIM, PEAPv0, PEAPv1, and LEAP. Bluetooth Bluetooth support in iOS has been designed to provide useful functionality without unnecessary increased access to private data. iOS devices support Encryption Mode 3, Security Mode 4, and Service Level 1 connections. iOS supports the following Bluetooth profiles: • Hands-Free Profile (HFP 1.5) • Phone Book Access Profile (PBAP) • Advanced Audio Distribution Profile (A2DP) • Audio/Video Remote Control Profile (AVRCP) • Personal Area Network Profile (PAN) • Human Interface Device Profile (HID) Support for these profiles varies by device. For more information, see http://support.apple.com/kb/ht3647.15 iOS supports flexible security policies and configurations that are easily enforced and managed. This enables enterprises to protect corporate information and ensure that employees meet enterprise requirements, even if they are using devices they’ve provided themselves. Passcode Protection In addition to providing the cryptographic protection discussed earlier, passcodes prevent unauthorized access to the device’s UI. The iOS interface enforces escalating time delays after the entry of an invalid passcode, dramatically reducing the effectiveness of brute force attacks via the Lock screen. Users can choose to have the device automatically wiped after 10 failed passcode attempts. This setting is available as an administrative policy and can also be set to a lower threshold through MDM and Exchange ActiveSync. By default, the user’s passcode can be defined as a four-digit PIN. Users can specify a longer, alphanumeric passcode by turning on Settings > General > Passcode > Complex Passcode. Longer and more complex passcodes are harder to guess or attack, and are recommended for enterprise use. Administrators can enforce complex passcode requirements and other policies using MDM or Exchange ActiveSync, or by requiring users to manually install configuration profiles. The following passcode policies are available: • Allow simple value • Require alphanumeric value • Minimum passcode length • Minimum number of complex characters • Maximum passcode age • Passcode history • Auto-lock timeout • Grace period for device lock • Maximum number of failed attempts For details about each policy, see the iPhone Configuration Utility documentation at http://help.apple.com/iosdeployment-ipcu/. Configuration Enforcement A configuration profile is an XML file that allows an administrator to distribute configuration information to iOS devices. Settings that are defined by an installed configuration profile can’t be changed by the user. If the user deletes a configuration profile, all the settings defined by the profile are also removed. In this manner, administrators can Device Access16 enforce settings by tying policies to access. For example, a configuration profile that provides an email configuration can also specify a device passcode policy. Users won’t be able to access mail unless their passcodes meet the administrator’s requirements. An iOS configuration profile contains a number of settings that can be specified: • Passcode policies • Restrictions on device features (disabling the camera, for example) • Wi-Fi settings • VPN settings • Email server settings • Exchange settings • LDAP directory service settings • CalDAV calendar service settings • Web clips • Credentials and keys • Advanced cellular network settings Configuration profiles can be signed and encrypted to validate their origin, ensure their integrity, and protect their contents. Configuration profiles are encrypted using CMS (RFC 3852), supporting 3DES and AES-128. Configuration profiles can also be locked to a device to completely prevent their removal, or to allow removal only with a passcode. Since many enterprise users personally own their iOS devices, configuration profiles that bind a device to an MDM server can be removed—but doing so will also remove all managed configuration information, data, and apps. Users can install configuration profiles directly on their devices using the iPhone Configuration Utility. Configuration profiles can be downloaded via email or over-the-air using an MDM server. Mobile Device Management iOS support for MDM allows businesses to securely configure and manage scaled iPhone and iPad deployments across their organizations. MDM capabilities are built on existing iOS technologies such as Configuration Profiles, Over-the-Air Enrollment, and the Apple Push Notification service. Using MDM, IT departments can enroll iOS devices in an enterprise environment, wirelessly configure and update settings, monitor compliance with corporate policies, and even remotely wipe or lock managed devices. For more information on Mobile Device Management, visit www.apple.com/business/mdm. Device Restrictions Administrators can restrict device features by installing a configuration profile. The following restrictions are available: • Allow app installs • Allow use of camera • Allow FaceTime • Allow screen capture • Allow voice dialing • Allow automatic sync while roaming • Allow in-app purchases • Force user to enter store password for all purchases • Allow multiplayer gaming • Allow adding Game Center Friends • Allow Siri17 • Allow Siri while device is locked • Allow use of YouTube • Allow use of iTunes Store • Allow use of Safari • Enable Safari autofill • Force Fraudulent Website Warning • Enable JavaScript • Block pop-ups • Accept cookies • Allow iCloud backup • Allow iCloud document sync • Allow Photo Stream • Allow diagnostics to be sent to Apple • Allow user to accept untrusted TLS certificates • Force encrypted backups • Restrict media by content rating Remote Wipe iOS devices can be erased remotely by an administrator or user. Instant remote wiping is achieved by securely discarding the block storage encryption key from Effaceable Storage, rendering all data unreadable. Remote wiping can be initiated by MDM, Exchange, or iCloud. When remote wiping is triggered by MDM or iCloud, the device sends an acknowledgment and performs the wipe. For remote wiping via Exchange, the device checks in with the Exchange Server before performing the wipe. Users can also wipe devices in their possession using the Settings app. And as mentioned, devices can be set to automatically wipe after a series of failed passcode attempts.Conclusion A Commitment to Security Each component of the iOS security platform, from hardware to encryption to device access, provides organizations with the resources they need to build enterprise-grade security solutions. The sum of these parts gives iOS its industry-leading security features, without making the device difficult or cumbersome to use. Apple uses this security infrastructure throughout iOS and the iOS apps ecosystem. Hardware-based storage encryption provides instant remote wipe capabilities when a device is lost, and ensures that users can completely remove all corporate and personal information when a device is sold or transferred to another owner. For the collection of diagnostic information, unique identifiers are created to identify a device anonymously. Safari offers safe browsing with its support for OCSP, EV certificates, and certificate verification warnings. Mail leverages certificates for authenticated and encrypted email by supporting S/MIME. iMessage and FaceTime provide client-to-client encryption as well. The combination of required code signing, sandboxing, and entitlements in apps provides solid protection against viruses, malware, and other exploits that compromise the security of other platforms. The App Store submission process works to further protect users from these risks by reviewing every app before it’s made available for sale. Businesses are encouraged to review their IT and security policies to ensure they are taking full advantage of the layers of security technology and features offered by the iOS platform. Apple maintains a dedicated security team to support all Apple products. The team provides security auditing and testing for products under development as well as released products. The Apple team also provides security tools and training, and actively monitors for reports of new security issues and threats. Apple is a member of the Forum of Incident Response and Security Teams (FIRST). For information about reporting issues to Apple and subscribing to security notifications, go to apple.com/support/security. Apple is committed to incorporating proven encryption methods and creating modern mobile-centric privacy and security technologies to ensure that iOS devices can be used with confidence in any personal or corporate environment. 1819 Address space layout randomization (ASLR) A technique employed by iOS to make the successful exploitation of a software bug much more difficult. By ensuring memory addresses and offsets are unpredictable, exploit code can’t hard code these values. In iOS 5, the position of all system apps and libraries are randomized, along with all third-party apps compiled as positionindependent executables. Boot ROM The very first code executed by a device’s processor when it first boots. As an integral part of the processor, it can’t be altered by either Apple or an attacker. Data Protection File and keychain protection mechanism for iOS. It can also refer to the APIs that apps use to protect files and keychain items. DFU A mode in which a device’s Boot ROM code waits to be recovered over USB. The screen is black when in DFU mode, but upon connecting to a computer running iTunes, the following prompt is presented: “iTunes has detected an iPad in recovery mode. You must restore this iPad before it can be used with iTunes.” ECID A 64-bit identifier that’s unique to the processor in each iOS device. Used as part of the personalization process, it’s not considered a secret. Effaceable Storage A dedicated area of NAND storage, used to store cryptographic keys, that can be addressed directly and wiped securely. While it doesn’t provide protection if an attacker has physical possession of a device, keys held in Effaceable Storage can be used as part of a key hierarchy to facilitate fast wipe and forward security. File system key The key that encrypts each file’s metadata, including its class key. This is kept in Effaceable Storage to facilitate fast wipe, rather than confidentiality. GID Like the UID but common to every processor in a class. iBoot Code that’s loaded by LLB, and in turn loads XNU, as part of the secure boot chain. Keybag A data structure used to store a collection of class keys. Each type (System, Backup, Escrow, or iCloud Backup) has the same format: • A header containing: – Version (set to 3 in iOS 5) – Type (System, Backup, Escrow, or iCloud Backup) – Keybag UUID – An HMAC if the keybag is signed – The method used for wrapping the class keys: tangling with the UID or PBKDF2, along with the salt and iteration count • A list of class keys: – Key UUID – Class (which file or keychain Data Protection class this is) – Wrapping type (UID-derived key only; UID-derived key and passcode-derived key) – Wrapped class key – Public key for asymmetric classes Glossary20 Keychain The infrastructure and a set of APIs used by iOS and third-party apps to store and retrieve passwords, keys, and other sensitive credentials. Key wrapping Encrypting one key with another. iOS uses NIST AES key wrapping, as per RFC 3394. Low-Level Bootloader (LLB) Code that’s invoked by the Boot ROM, and in turn loads iBoot, as part of the secure boot chain. Per-file key The AES 256-bit key used to encrypt a file on the file system. The per-file key is wrapped by a class key and is stored in the file’s metadata. Provisioning profile A plist signed by Apple that contains a set of entities and entitlements allowing apps to be installed and tested on an iOS device. A development provisioning profile lists the devices that a developer has chosen for ad hoc distribution, and a distribution provisioning profile contains the app ID of an enterprise-developed app. Tangling The process by which a user’s passcode is turned into a cryptographic key and strengthened with the device’s UID. This ensures that a brute-force attack must be performed on a given device, and thus is rate limited and cannot be performed in parallel. The tangling algorithm is PBKDF2, which uses AES as the pseudorandom function (PRF) with a UID-derived key. UID A 256-bit AES key that’s burned into each processor at manufacture. It cannot be read by firmware or software, and is used only by the processor’s hardware AES engine. To obtain the actual key, an attacker would have to mount a highly sophisticated and expensive physical attack against the processor’s silicon. The UID is not related to any other identifier on the device including, but not limited to, the UDID. XNU The kernel at the heart of the iOS and OS X operating systems. It’s assumed to be trusted, and enforces security measures such as code signing, sandboxing, entitlement checking, and ASLR. Yarrow A cryptographically secure pseudorandom number generator algorithm. An implementation of Yarrow in iOS takes entropy generated by various system events and produces unpredictable random numbers that can be used, for example, as encryption keys. © 2012 Apple Inc. All rights reserved. Apple, the Apple logo, FaceTime, iPad, iPhone, iPod touch, iTunes, Keychain, OS X, Safari, Siri, and Xcode are trademarks of Apple Inc., registered in the U.S. and other countries. iMessage is a trademark of Apple Inc. iCloud and iTunes Store are service marks of Apple Inc., registered in the U.S. and other countries. App Store is a service mark of Apple Inc. The Bluetooth® word mark and logos are registered trademarks owned by Bluetooth SIG, Inc. and any use of such marks by Apple is under license. Other product and company names mentioned herein may be trademarks of their respective companies. Product specifications are subject to change without notice. May 2012 Guide d’informations importantes sur le produit MacBook ProEau et endroits humides Évitez de placer votre MacBook Pro à proximité de sources de liquide telles que des boissons, un évier, un lavabo, une baignoire ou une douche, par exemple. Protégez votre MacBook Pro de l’humidité et des intempéries (neige, pluie et brouillard par exemple). Adaptateur secteur MagSafe 2 85 W N’utilisez que l’adaptateur secteur qui accompagne le MacBook Pro ou, au besoin, un adaptateur secteur agréé Apple compatible avec ce produit. Veillez à ce que la fiche ou le câble d’alimentation secteur CA soit totalement enclenché dans l’adaptateur secteur avant de brancher ce dernier sur une prise de courant. L’adaptateur secteur peut chauffer au cours d’une utilisation normale de l’appareil. L’adaptateur secteur MagSafe 2 respecte les limites de température de surfaces accessible à l’utilisateur définies par la norme IEC 6590-1 (International Standard for Safety of Information Technology Equipment), Pour réduire la possibilité de surchauffe de l’adaptateur secteur et de blessures liées à la chaleur, effectuez l’une des actions suivantes :  Branchez directement l’adaptateur secteur à une prise secteur. Fiche CA Connecteur MagSafe 2 Adaptateur secteur MagSafe 2  Si vous utilisez le cordon d’alimentation secteur, placez l’adaptateur secteur sur un bureau, une table ou le sol, dans un endroit bien ventilé. Connecteur MagSafe 2 Adaptateur secteur MagSafe 2 Câble secteur Débranchez l’adaptateur secteur et débranchez tous les autres câbles si l’un des cas suivants se présente :  Vous souhaitez nettoyer le boîtier (pour ce faire, suivez à la lettre les instructions fournies à la page suivante).  La prise ou le câble d’alimentation est endommagé.  Le MacBook Pro ou l’adaptateur secteur est exposé à la pluie ou à une humidité excessive, ou du liquide a été versé dans le boîtier.  Le MacBook Pro ou l’adaptateur secteur a subi une chute, le boîtier a été endommagé ou vous pensez qu’une réparation est nécessaire. Le port secteur MagSafe 2 (sur lequel vous branchez le connecteur MagSafe 2) contient un aimant qui peut effacer les données d’une carte de crédit, d’un iPod ou d’autres appareils. Ce Guide d’informations importantes sur le produit contient des informations relatives à la sécurité, à la manipulation, à l’élimination et au recyclage, à la réglementation et à la licence logicielle, ainsi que la garantie limitée d’un an pour votre MacBook Pro de 15 pouces. ±Afin d’éviter toute blessure, consultez les informations relatives à la sécurité ci-dessous, ainsi que le mode d’emploi, avant d’utiliser le MacBook Pro. Une version téléchargeable du Guide de démarrage rapide du MacBook Pro et la plus récente version de ce Guide d’informations importantes sur le produit sont disponibles à la page : support.apple.com/manuals/macbookpro Informations importantes de sécurité et de manipulation AVERTISSEMENT :  Ne pas suivre ces consignes pourrait déclencher un feu, occasionner des décharges électriques ou entraîner tout type de blessure ou dommage du MacBook Pro ou autre. Batterie intégrée Ne retirez pas la batterie de votre MacBook Pro. La batterie doit être remplacée uniquement par un Centre de services agréé Apple Abandonnez toute utilisation de votre MacBook Pro après une chute ou s’il semble avoir été écrasé, plié, déformé ou endommagé. N’exposez pas votre MacBook Pro à des sources extrêmes de chaleur, telles que des radiateurs ou des cheminées, où la température est susceptible d’excéder 100 °C. Manipulation correcte La partie inférieure du MacBook Pro peut chauffer au cours d’une utilisation normale de l’appareil. Le MacBook Pro respecte les limites de température de surfaces accessible à l’utilisateur définies par la norme IEC 6590-1 (International Standard for Safety of Information Technology Equipment). Pour un fonctionnement de l’ordinateur en toute sécurité et une réduction de la possibilité de blessures liées à la chaleur, suivez les directives suivantes :  Installez le MacBook Pro sur un plan de travail stable en veillant à ce que l’air puisse circuler librement sous l’ordinateur et autour de celui-ci.  N’utilisez pas le MacBook Pro en le posant sur un coussin, une couverture ou tout autre objet de structure non solide, car cela pourrait empêcher les conduits d’aération de fonctionner correctement.  Évitez également de placer des objets sur le clavier lorsque vous utilisez votre MacBook Pro.  N’introduisez aucun objet dans les ouvertures servant à la ventilation.  Si votre MacBook Pro est posé sur vos genoux et que la chaleur qu’il dégage vous gêne, posez-le plutôt sur un plan de travail stable.Manipulation des parties en verre Votre MacBook Pro contient des composants en verre, notamment l’écran et le trackpad. Si ces parties sont abîmées, n’utilisez pas votre MacBook Pro tant qu’il n’a pas été réparé par un Centre de Services Agréé Apple. Stockage du MacBook Pro Si vous décidez de ranger le MacBook Pro pendant une longue période, placez-le dans un endroit frais (idéalement, à 22 °C), et déchargez la batterie à 50 pour cent. Avant de ranger votre ordinateur pour une période supérieure à cinq mois, déchargez la batterie à environ 50 pour cent. Pour conserver les capacités de la batterie, rechargez la batterie jusqu’à 50 pour cent tous les six mois environ. Nettoyage du MacBook Pro Pour nettoyer le boîtier de votre MacBook Pro et de ses composants, éteignez d’abord le MacBook Pro et débranchez l’adaptateur secteur. Humidifiez ensuite le chiffon fourni et essuyez le MacBook Pro. Évitez les infiltrations d’humidité par quelque ouverture que ce soit. Ne vaporisez jamais de liquide directement sur l’ordinateur. N’utilisez ni aérosols, ni dissolvants, ni abrasifs qui pourraient endommager les finitions de l’appareil. Nettoyage de l’écran du MacBook Pro Pour nettoyer l’écran du MacBook Pro, éteignez d’abord le MacBook Pro et débranchez l’adaptateur secteur. Humidifiez ensuite, à l’eau seulement, le chiffon fourni et essuyez l’écran. Ne vaporisez jamais de liquide directement sur l’écran. Ergonomie Voici quelques conseils pour la mise en place d’un environnement de travail sain. Clavier et trackpad Lorsque vous tapez au clavier ou que vous vous servez du trackpad, vos épaules doivent être détendues. Le bras et l’avant-bras doivent former un angle droit, la main étant placée dans le prolongement du poignet. Position à éviter Position recommandée Vous devez avoir les mains et les doigts détendus lorsque vous tapez au clavier ou que vous utilisez le trackpad. Évitez de replier les pouces à l’intérieur des paumes. Position à éviter Position recommandée Pour protéger vos données, ne placez pas de matériaux ou d’appareils à sensibilité magnétique (comme ceux cités précédemment ou autres) à moins de 25 mm de ce port. Si des résidus quelconques se trouvent dans le port secteur MagSafe 2, enlevez-les doucement à l’aide d’un bâtonnet de coton. Spécifications de l’alimentation MagSafe 2 : Fréquence : phase unique de 50 à 60 Hz Tension de secteur : de 100 à 240 V Tension de sortie : 20 V DC, 4,25 A Diminution de l’acuité auditive Vous risquez une perte d’audition irréparable si vous utilisez un casque ou des écouteurs à un volume sonore élevé. L’oreille peut s’adapter petit à petit à des volumes sonores de plus en plus élevés qui peuvent sembler normaux,mais qui risquent à la longue d’endommager votre système auditif. En cas de sifflements ou de perte d’acuité auditive, arrêtez d’utiliser le casque ou les écouteurs et consultez un médecin. Plus le volume est élevé, plus votre audition risque d’être affectée rapidement. Pour protéger votre système auditif, les spécialistes conseillent de prendre les mesures suivantes :  Limitez la durée d’utilisation à volume élevé de vos écouteurs ou de votre casque d’écoute.  Évitez d’augmenter le volume afin de bloquer les bruits environnants.  Baissez le volume si vous ne parvenez pas à entendre une personne qui parle à côté de vous. Activités à haut risque Cet ordinateur n’est pas conçu pour être utilisé dans des installations nucléaires, pour la navigation ou la communication aérienne, pour le contrôle du trafic aérien, ni dans aucune autre situation où une panne du système informatique pourrait entraîner la mort, des blessures ou de graves dommages écologiques. Environnement d’utilisation L’utilisation de votre MacBook Pro en dehors de ces plages peut gêner son bon fonctionnement : Température de fonctionnement : de 10 à 35 °C Température de stockage : de -20 à 45 °C Humidité relative : de 5 % à 90 % (sans condensation) Altitude de fonctionnement : de 0 à 3 048 mètres Transport du MacBook Pro Si vous transportez le MacBook Pro dans un sac ou dans un attaché-case, assurezvous que ce dernier ne contient pas d’objets non attachés (des trombones ou des pièces de monnaie, par exemple) qui pourraient pénétrer accidentellement dans l’ordinateur par une ouverture ou se coincer à l’intérieur d’un port. Maintenez également à l’écart du port secteur MagSafe 2 tout objet à sensibilité magnétique. Utilisation des connecteurs et des ports Ne forcez jamais un connecteur à entrer dans un port. Lorsque vous branchez un appareil, assurez-vous que le port ne contient aucun résidu quelconque, que le connecteur correspond bien au port et qu’il est placé de manière à entrer correctement dans le port.Centre d’aide Vous pouvez trouver des réponses à vos questions ainsi que des instructions et des informations concernant le dépannage dans le Centre d’aide. Cliquez sur l’icône Finder, cliquez sur Aide dans la barre des menus et choisissez Centre d’aide. Informations en ligne Pour obtenir des informations en ligne sur le service et l’assistance, consultez la page www.apple.com/fr/support et choisissez votre pays dans le menu local. Vous pouvez faire des recherches dans la base de données AppleCare Knowledge Base, vérifier si de nouvelles mises à jour de logiciels sont disponibles ou obtenir de l’aide dans les forums de discussion Apple. Informations système Pour obtenir des informations sur votre MacBook Pro, servezvous d’Informations système. Cette application vous fournit la liste des composants matériels et des logiciels installés, le numéro de série et de version du système d’exploitation, la quantité de mémoire installée, etc. Pour ouvrir Informations système, choisissez le menu Pomme () > À propos de ce Mac dans la barre des menus, puis cliquez sur Plus d’infos. Apple Hardware Test Utilisez l’application Apple Hardware Test (AHT) pour savoir s’il y a un problème avec les composants matériels de l’ordinateur (les composants affectés peuvent être la mémoire ou le processeur, par exemple). Pour utiliser Apple Hardware Test : Déconnectez tous les périphériques externes de votre ordinateur, sauf l’adaptateur secteur. Redémarrez ensuite votre ordinateur en maintenant la touche D enfoncée lors du démarrage. Lorsque l’écran de sélection d’AHT s’affiche, choisissez votre langue. Appuyez sur la touche Retour ou cliquez sur la flèche droite. Lorsque l’écran principal d’AHT s’affiche (après 45 secondes environ), suivez les instructions à l’écran. En cas de détection d’un problème, AHT affiche un code d’erreur. Notez le code d’erreur avant d’entreprendre les démarches d’assistance. Si AHT ne détecte pas de panne matérielle, il est probable que le problème soit lié aux logiciels. Service et assistance AppleCare Votre MacBook Pro bénéficie d’une assistance technique de 90 jours et d’un an de couverture pour les réparations de matériel effectuées dans les magasins Apple Store ou les centres de réparation agréés Apple, tels que les Centres de services agréés Apple. Vous avez la possibilité d’étendre la durée de cette couverture en adhérant à un programme AppleCare Protection Plan. Pour en savoir plus, consultez la page www.apple.com/fr/support/products ou le site web correspondant à votre pays (la liste figure plus loin dans cette section). Modifiez fréquemment la position de vos mains pour éviter la fatigue. Après un travail continu et intensif sur ordinateur, certains utilisateurs peuvent ressentir des douleurs aux mains, aux poignets ou aux bras. Si ces douleurs persistent, consultez un spécialiste. Souris externe Si vous utilisez une souris externe, veillez à ce qu’elle se trouve à hauteur du clavier. Ménagez un espace suffisant pour la manipuler avec aisance. Siège Optez pour un siège de bureau réglable et offrant un dossier et une assise confortables. Réglez la hauteur du siège de telle sorte que vos cuisses reposent à l’horizontale et vos pieds à plat sur le sol. Le dossier du siège doit soutenir votre région lombaire, c’est-à-dire la partie inférieure de votre dos. Suivez les instructions du fabricant de sorte que le réglage du dossier soit parfaitement adapté à votre morphologie. Au besoin, relevez le siège de manière à ce que vos avantbras et vos mains soient placés correctement par rapport au clavier. Si, dans ce cas, vos pieds ne reposent plus à plat sur le sol, utilisez un repose-pied inclinable et réglable en hauteur. Si vous disposez d’un bureau modulaire, vous pouvez abaisser le niveau du plan de travail pour éviter l’emploi d’un repose-pied. Une troisième solution consiste à utiliser un bureau dont le poste de saisie est situé plus bas que le plan de travail. Écran intégré Orientez l’écran de manière à minimiser les reflets des lampes et fenêtres alentour. Ne forcez pas l’écran si vous rencontrez une résistance. L’angle d’ouverture maximal de l’écran ne peut dépasser 135 degrés. Réglez la luminosité et le contraste de l’écran chaque fois que vous déplacez l’ordinateur ou que l’éclairage ambiant change. Vous trouverez d’autres informations concernant l’ergonomie sur Internet : www.apple.com/about/ergonomics (en anglais) Apple et l’environnement Apple Inc. reconnaît sa responsabilité en matière de réduction de l’impact de ses produits et de ses activités sur l’environnement. Des informations supplémentaires sont disponibles sur Internet :www.apple.com/fr/environment Informations, services et assistance Votre MacBook Pro ne contient aucune pièce réparable par l’utilisateur. Si vous avez besoin de services de réparation, adressez-vous à Apple ou déposez votre MacBook Pro dans un Centre de Services Agréé Apple. Vous trouverez de plus amples informations sur le MacBook Pro dans le Centre d’aide, en ligne, dans Informations système et via Apple Hardware Test. Move the computer farther away from the television or radio.  Plug the computer into an outlet that is on a different circuit from the television or radio. (That is, make certain the computer and the television or radio are on circuits controlled by different circuit breakers or fuses.) If necessary, consult an Apple Authorized Service Provider or Apple. See the service and support information that came with your Apple product. Or consult an experienced radio/ television technician for additional suggestions. Important: Changes or modifications to this product not authorized by Apple Inc. could void the EMC compliance and negate your authority to operate the product. This product has demonstrated EMC compliance under conditions that included the use of compliant peripheral devices and shielded cables (including Ethernet network cables) between system components. It is important that you use compliant peripheral devices and shielded cables between system components to reduce the possibility of causing interference to radios, television sets, and other electronic devices. Responsible party (contact for FCC matters only): Apple Inc. Corporate Compliance 1 Infinite Loop, MS 91-1EMC Cupertino, CA 95014 Wireless Radio Use This device is restricted to indoor use when operating in the 5.15 to 5.25 GHz frequency band. Cet appareil doit être utilisé à l’intérieur. Exposure to Radio Frequency Energy The radiated output power of the AirPort Extreme technology is below the FCC and EU radio frequency exposure limits. Nevertheless, it is advised to use the wireless equipment in such a manner that the potential for human contact during normal operation is minimized. FCC Bluetooth® Wireless Compliance The antenna used with this transmitter must not be colocated or operated in conjunction with any other antenna or transmitter subject to the conditions of the FCC Grant. Canadian Compliance Statement This device complies with Industry Canada license-exempt RSS standard(s). Operation is subject to the following two conditions: (1) this device may not cause interference, and (2) this device must accept any interference, including interference that may cause undesired operation of the device. Si vous avez besoin d’assistance, le personnel d’assistance par téléphone AppleCare peut vous aider à installer et à ouvrir les applications, et propose des services de dépannage. Appelez le centre d’assistance le plus proche de chez vous (gratuit pendant les 90 premiers jours). Gardez la date d’achat et le numéro de série de votre MacBook Pro à portée de main lorsque vous appelez. La période de 90 jours d’assistance gratuite par téléphone débute à la date d’achat. France : (33) 0805 540 003 France DOM-TOM : (33) 0825 77 00 35 Belgique : (32) 070 700 773 Suisse : (41) 0848 000 132 www.apple.com/support/country Les numéros de téléphone sont susceptibles d’être modifiés. Les tarifs téléphoniques locaux et nationaux peuvent s’appliquer. Une liste complète est disponible sur Internet : www.apple.com/fr/support/contact Regulatory Compliance Information FCC Compliance Statement This device complies with part 15 of the FCC rules. Operation is subject to the following two conditions: (1) This device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. See instructions if interference to radio or television reception is suspected. Radio and Television Interference This computer equipment generates, uses, and can radiate radio-frequency energy. If it is not installed and used properly—that is, in strict accordance with Apple’s instructions—it may cause interference with radio and television reception. This equipment has been tested and found to comply with the limits for a Class B digital device in accordance with the specifications in Part 15 of FCC rules. These specifications are designed to provide reasonable protection against such interference in a residential installation. However, there is no guarantee that interference will not occur in a particular installation. You can determine whether your computer system is causing interference by turning it off. If the interference stops, it was probably caused by the computer or one of the peripheral devices. If your computer system does cause interference to radio or television reception, try to correct the interference by using one or more of the following measures:  Turn the television or radio antenna until the interference stops.  Move the computer to one side or the other of the television or radio. Français Par la présente Apple Inc. déclare que l’appareil MacBook Pro est conforme aux exigences essentielles et aux autres dispositions pertinentes de la directive 1999/5/CE. Islenska Apple Inc. lýsir því hér með yfir að þetta tæki MacBook Pro fullnægir lágmarkskröfum og öðrum viðeigandi ákvæðum Evróputilskipunar 1999/5/EC. Italiano Con la presente Apple Inc. dichiara che questo dispositivo MacBook Pro è conforme ai requisiti essenziali ed alle altre disposizioni pertinenti stabilite dalla direttiva 1999/5/CE. Latviski Ar šo Apple Inc. deklarē, ka MacBook Pro ierīce atbilst Direktīvas 1999/5/EK būtiskajām prasībām un citiem ar to saistītajiem noteikumiem. Lietuvių Šiuo „Apple Inc.“ deklaruoja, kad šis MacBook Pro atitinka esminius reikalavimus ir kitas 1999/5/EB Direktyvos nuostatas. Magyar Alulírott, Apple Inc. nyilatkozom, hogy a MacBook Pro megfelel a vonatkozó alapvetõ követelményeknek és az 1999/5/EC irányelv egyéb elõírásainak. Malti Hawnhekk, Apple Inc., jiddikjara li dan MacBook Pro jikkonforma mal-ħtiġijiet essenzjali u ma provvedimenti oħrajn relevanti li hemm fid-Dirrettiva 1999/5/EC. Nederlands Hierbij verklaart Apple Inc. dat het toestel MacBook Pro in overeenstemming is met de essentiële eisen en de andere bepalingen van richtlijn 1999/5/EG. Norsk Apple Inc. erklærer herved at dette MacBook Pro -apparatet er i samsvar med de grunnleggende kravene og øvrige relevante krav i EU-direktivet 1999/5/EF. Polski Niniejszym Apple Inc. oświadcza, że ten MacBook Pro są zgodne z zasadniczymi wymogami oraz pozostałymi stosownymi postanowieniami Dyrektywy 1999/5/EC. Português Apple Inc. declara que este dispositivo MacBook Pro está em conformidade com os requisitos essenciais e outras disposições da Directiva 1999/5/CE. Română Prin prezenta, Apple Inc. declară că acest aparat MacBook Pro este în conformitate cu cerinţele esenţiale şi cu celelalte prevederi relevante ale Directivei 1999/5/CE. Slovensko Apple Inc. izjavlja, da je ta MacBook Pro skladne z bistvenimi zahtevami in ostalimi ustreznimi določili direktive 1999/5/ES. Slovensky Apple Inc. týmto vyhlasuje, že toto MacBook Pro spĺňa základné požiadavky a všetky príslušné ustanovenia Smernice 1999/5/ES. Suomi Apple Inc. vakuuttaa täten, että tämä MacBook Pro tyyppinen laite on direktiivin 1999/5/EY oleellisten vaatimusten ja sitä koskevien direktiivin muiden ehtojen mukainen. Svenska Härmed intygar Apple Inc. att denna MacBook Pro står i överensstämmelse med de väsentliga egenskapskrav och övriga relevanta bestämmelser som framgår av direktiv 1999/5/EG. Cet appareil est conforme aux normes CNR exemptes de licence d’Industrie Canada. Le fonctionnement est soumis aux deux conditions suivantes : (1) cet appareil ne doit pas provoquer d’interférences et (2) cet appareil doit accepter toute interférence, y compris celles susceptibles de provoquer un fonctionnement non souhaité de l’appareil. Bluetooth Industry Canada Statement This Class B device meets all requirements of the Canadian interference-causing equipment regulations. Cet appareil numérique de la Class B respecte toutes les exigences du Règlement sur le matériel brouilleur du Canada. Industry Canada Statement Complies with the Canadian ICES-003 Class B specifications. Cet appareil numérique de la classe B est conforme à la norme NMB-003 du Canada. This device complies with RSS 210 of Industry Canada. European Compliance Statement This product complies with the requirements of European Directives 2006/95/EC, 2004/108/EC, and 1999/5/EC. Europe–EU Declaration of Conformity Български Apple Inc. декларира, че това MacBook Pro е в съответствие със съществените изисквания и другите приложими правила на Директива 1999/5/ЕС. Česky Společnost Apple Inc. tímto prohlašuje, že tento MacBook Pro je ve shodě se základními požadavky a dalšími příslušnými ustanoveními směrnice 1999/5/ES. Dansk Undertegnede Apple Inc. erklærer herved, at følgende udstyr MacBook Pro overholder de væsentlige krav og øvrige relevante krav i direktiv 1999/5/EF. Deutsch Hiermit erklärt Apple Inc., dass sich das MacBook Pro in Übereinstimmung mit den grundlegenden Anforderungen und den übrigen einschlägigen Bestimmungen der Richtlinie 1999/5/EG befinden. Eesti Käesolevaga kinnitab Apple Inc., et see MacBook Pro vastab direktiivi 1999/5/EÜ põhinõuetele ja nimetatud direktiivist tulenevatele teistele asjakohastele sätetele. English Hereby, Apple Inc. declares that this MacBook Pro is in compliance with the essential requirements and other relevant provisions of Directive 1999/5/EC. Español Por medio de la presente Apple Inc. declara que este MacBook Pro cumple con los requisitos esenciales y cualesquiera otras disposiciones aplicables o exigibles de la Directiva 1999/5/CE. Ελληνικά Mε την παρούσα, η Apple Inc. δηλώνει ότι αυτή η συσκευή MacBook Pro συμμορφώνεται προς τις βασικές απαιτήσεις και τις λοιπές σχετικές διατάξεις της Οδηγίας 1999/5/ΕΚ.警告 本電池如果更換不正確會有爆炸的危險 請依製造商說明書處理用過之電池 Japan VCCI Class B Statement Russia Informations sur le modem externe USB Lorsque vous connectez votre MacBook Pro à la ligne téléphonique à l’aide d’un modem externe USB, référez-vous à la section relative à l’entreprise de télécommunications dans la documentation fournie avec le modem. ENERGY STAR® Compliance As an ENERGY STAR® partner, Apple has determined that standard configurations of this product meet the ENERGY STAR® guidelines for energy efficiency. The ENERGY STAR® program is a partnership with electronic equipment manufacturers to promote energy-efficient products. Reducing energy consumption of products saves money and helps conserve valuable resources. This computer is shipped with power management enabled with the computer set to sleep after 10 minutes of user inactivity. To wake your computer, click the mouse or trackpad button or press any key on the keyboard. For more information about ENERGY STAR®, visit: www.energystar.gov A copy of the EU Declaration of Conformity is available at: www.apple.com/euro/compliance This equipment can be used in the following countries: European Community Restrictions Français Pour usage en intérieur uniquement. Consultez l’Autorité de Régulation des Communications Electroniques et des Postes (ARCEP) pour connaître les limites d’utilisation des canaux 1 à 13. www.arcep.fr Korea Warning Statements B૶ૺૺ(ਜ਼ႜဧ෮໽ቛཅૺၴႁ) ၦૺૺ௴ਜ਼ႜဧ(B૶) ႖ၴኒ႕ጁૺૺച໏჎ച ਜ਼ႜ࿝໏ຫဧዻ௴ઇၕඛ႕ၒചዻඑ, ක౷ხ ࿦࿝໏ຫဧዾ༘ၰཀఁఋ. ෮ቛ၁ધགྷ࿝ಋ൏ધხຫጃ ጄఙඳ໓໕๗௴ဪဧთ႖ኒጯཅਜ਼௻ໜၦၰၗ ၦૺૺ௴ၨ඗ྦ႖઴શഏౘ໏๗༺࿝ຫဧዾ༘࿖ཀఁఋ ఝዽූ૑ ૬ႜ ෟ ა༘ Singapore Wireless Certification Taiwan Wireless Statements Taiwan Class B StatementChina Battery Statement Taiwan Battery Statement Remplacement de la batterie La batterie rechargeable doit être remplacée uniquement par Apple ou un Centre de services agréé Apple. Pour en savoir plus sur les services de remplacement de la batterie, consultez le site : http://www.apple.com/fr/batteries/replacements.html Battery Charger Efficiency 020-5563-A EFUP15china Informations sur l’élimination et le recyclage Le symbole ci-dessus signifie que vous devez vous débarrasser de votre produit selon les normes et la législation de votre pays. Lorsque votre produit n’est plus utilisable, contactez Apple ou les autorités locales afin de connaître les possibilités de recyclage. Pour en savoir plus sur le programme de recyclage Apple, consultez le site : www.apple.com/fr/environment/recycling European Union—Disposal Information The symbol above means that according to local laws and regulations your product should be disposed of separately from household waste. When this product reaches its end of life, take it to a collection point designated by local authorities. Some collection points accept products for free. The separate collection and recycling of your product at the time of disposal will help conserve natural resources and ensure that it is recycled in a manner that protects human health and the environment. Türkiye EEE yönetmeliğine (Elektrikli ve Elektronik Eşyalarda Bazı Zararlı Maddelerin Kullanımının Sınırlandırılmasına Dair Yönetmelik) uygundur. Brasil—Informações sobre descarte e reciclagem O símbolo acima indica que este produto e/ou sua bateria não devem ser descartadas no lixo doméstico. Quando decidir descartar este produto e/ou sua bateria, faça-o de acordo com as leis e diretrizes ambientais locais. Para informações sobre o programa de reciclagem da Apple, pontos de coleta e telefone de informações, visite www.apple.com/br/environment. Informations sur l’enlèvement de la batterie Jetez vos batteries usagées en respectant les lois et les consignes environnementales de votre pays. Deutschland: Dieses Gerät enthält Batterien. Bitte nicht in den Hausmüll werfen. Entsorgen Sie dieses Gerät am Ende seines Lebenszyklus entsprechend der maßgeblichen gesetzlichen Regelungen. Nederlands: Gebruikte batterijen kunnen worden ingeleverd bij de chemokar of in een speciale batterijcontainer voor klein chemisch afval (kca) worden gedeponeerd.contenues dans la documentation technique, les manuels d’utilisation et les communications. CE QUI N’EST PAS COUVERT PAS LA PRESENTE GARANTIE COMMERCIALE La présente garantie commerciale ne s’applique pas aux produits ou logiciels qui ne sont pas de la marque Apple, même s’ils sont emballés ou vendus avec un Produit Apple. Les fabricants, fournisseurs ou éditeurs autres que Apple peuvent vous fournir leurs propres garanties mais Apple, dans la mesure de ce qui est permis par la loi, fournit leurs produits « en l’état ». Les logiciels distribués par Apple, sous la marque Apple ou non, (y compris, de façon non limitative, les logiciels de système) ne sont pas couverts par cette garantie. Nous vous prions de bien vouloir vous reporter au contrat de licence accompagnant le logiciel pour les détails de vos droits concernant son utilisation. Apple ne garantit pas que le fonctionnement du Produit Apple sera ininterrompu ou sans erreur. Apple n’est pas responsable des dommages provenant du non-respect des instructions d’utilisation du produit. Cette garantie ne s’applique pas : (a) aux pièces consommables, telles que les batteries, sauf si le dommage est dû à un vice de matière ou de fabrication ; (b) à tout dommage esthétique, comprenant notamment toute rayure, bosse ou élément en plastique de ports cassé ; (c) à tout dommage causé par l’utilisation avec un autre produit ; (d) à tout dommage causé par accident, abus, mauvaise utilisation, contact avec des éléments liquides, feu, tremblement de terre ou autres causes extérieures ; (e) à tout dommage causé par une utilisation du Produit Apple non conforme aux instructions diffusées par Apple ; (f) à tout dommage causé par toute intervention (y compris les mises à niveau et les extensions) effectuée par toute personne qui n’est pas un représentant d’Apple ou un prestataire de services agréé Apple («PSAA»); (g) à un Produit Apple qui a été modifié de telle manière à en altérer les fonctionnalités ou les capacités sans l’autorisation écrite d’Apple ; (h) aux défauts causés par une usure normale ou dus au vieillissement normal du produit ; ou (i) si un numéro de série Apple a été enlevé du Produit Apple ou rendu illisible. VOS RESPONSABILITES SI VOTRE PRODUIT APPLE EST CAPABLE DE STOCKER DES LOGICIELS, DONNES ET AUTRES INFORMATIONS, ALORS NOUS VOUS RECOMMANDONS D’EFFECTUER DES COPIES DE SAUVEGARDE PERIODIQUES DES INFORMATIONS CONTENUES SUR LE SUPPORT DE STOCKAGE AFIN D’EN PROTEGER LE CONTENU ET DE VOUS PREMUNIR CONTRE D’EVENTUELLES DEFAILLANCES DE FONCTIONNEMENT. Avant de pouvoir bénéficier du service de garantie, Apple ou ses représentants peuvent vous demander de fournir une preuve d’achat, de répondre à des questions dans le but de les assister à diagnostiquer les problèmes potentiels ou de suivre les procédures d’Apple pour obtenir le service de garantie. Avant de déposer votre Produit Apple pour tout service de garantie, vous vous engagez à créer une copie de sauvegarde du support de stockage, à effacer toutes les Contrat de licence du logiciel L’utilisation de MacBook Pro constitue l’acceptation des conditions générales des licences de logiciels d’Apple et de tierces parties, que vous pouvez consulter à l’adresse : www.apple.com/legal/sla Garantie d’Apple Limitée à un (1) an - Mac Pour les produits de marque Apple uniquement EN QUOI LE DROIT DE LA CONSOMMATION SE RAPPORTE-TIL A CETTE GARANTIE  CETTE GARANTIE VOUS CONFERE DES DROITS SPECIFIQUES ET IL SE PEUT QUE VOUS BENEFICIIEZ D’AUTRES DROITS EN FONCTION DE VOTRE PAYS, REGION OU ETAT, Y COMPRIS POUR LES CONSOMMATEURS FRANÇAIS LES DROITS DETAILLES CI-DESSOUS. A L’EXCEPTION DE CE QUI EST AUTORISE PAR LA LOI, APPLE N’EXCLUT, NE LIMITE NI NE SUSPEND AUCUN DES AUTRES DROITS DONT VOUS POURRIEZ BENEFICIER, NOTAMMENT CEUX RESULTANT DE LA GARANTIE LEGALE DE CONFORMITÉ ATTACHEE AU CONTRAT DE VENTE. AFIN DE PRENDRE PLEINEMENT CONNAISSANCE DE VOS DROITS, NOUS VOUS INVITONS A CONSULTER LES LOIS DE VOTRE PAYS, REGION OU ETAT. LES LIMITATIONS DE GARANTIE POUVANT AFFECTER LE DROIT DE LA CONSOMMATION DANS LA MESURE AUTORISEE PAR LA LOI, LA PRESENTE GARANTIE ET LES RECOURS STIPULES CI-DESSUS SONT EXCLUSIFS ET SONT EN LIEU ET PLACE DE TOUTES AUTRES GARANTIES, RECOURS ET DROITS, QU’ILS SOIENT ECRITS OU ORAUX, LEGAUX, EXPRES OU TACITES. APPLE EXCLUT EXPRESSEMENT TOUTES GARANTIES LEGALES ET TACITES, Y COMPRIS ET SANS QUE CETTE LISTE NE SOIT LIMITATIVE, LES GARANTIES DE QUALITE MARCHANDE, DE CONFORMITE A UN USAGE PARTICULIER ET DES VICES CACHES OU LATENTS, DANS LA MESURE DE CE QUI EST PERMIS PAR LA LOI. SI CES GARANTIES NE PEUVENT PAS VALABLEMENT ETRE EXCLUES, APPLE LIMITERA, DANS LA MESURE AUTORISEE, LA DUREE DE CELLES-CI ET LES RECOURS Y AFFERENTS, A LA DUREE DE LA PRESENTE GARANTIE COMMERCIALE ET, A LA DISCRETION D’APPLE, A LA REPARATION OU AU REMPLACEMENT DU PRODUIT, COMME DECRIT CI-DESSOUS. CERTAINS PAYS, ETATS OU REGIONS N’AUTORISENT PAS LA LIMITATION DE LA DUREE DES GARANTIES LEGALES. DE CE FAIT, LES LIMITATIONS PREVUES CI-DESSUS PEUVENT NE PAS S’APPLIQUER A VOUS. CE QUI EST COUVERT PAR LA PRESENTE GARANTIE COMMERCIALE Apple garantit le produit de marque Apple et ses accessoires tels que contenus dans l’emballage d’origine (le “Produit Apple”) contre les vices de fabrication et de matière, dans des conditions normales d’utilisation, conformément aux instructions diffusées par Apple, pour une durée de UN (1) AN à compter de la date d’achat par l’acheteur final (“Durée de la Garantie”). Les instructions diffusées par Apple incluent, sans limitation, les informations d’emballage, afin que vous puissiez faire parvenir votre Produit Apple à un SRA ou à un PSAA, conformément aux instructions d’Apple. Une fois le service effectué, le SRA ou le PSAA vous renverra le Produit Apple. Si toutes les instructions sont suivies, Apple assumera les frais d’envoi et de retour. (iii) Service “faites-le vous-même” (“DIY”). Le service DIY vous permet de réparer vous-même votre Produit Apple. Si le service DIY est applicable compte tenu des circonstances, les procédures suivantes pourront, selon les cas, s’appliquer : (a) Service pour lequel Apple vous demande le retour du produit ou de la pièce remplacé(e). Apple pourra vous demander une autorisation de prélèvement sur votre carte de crédit pour garantir le prix au détail du produit ou de la pièce de remplacement ainsi que les coûts de transport applicables. Si vous n’êtes pas en mesure de fournir une telle autorisation, vous pourrez ne pas être en mesure d’accéder au service DIY et Apple vous proposera alors une solution alternative. Apple vous enverra le produit ou la pièce de remplacement avec, le cas échéant, les instructions pour l’installer, ainsi que les conditions de renvoi du produit ou de la pièce remplacée. Si vous suivez les instructions, Apple annulera l’autorisation de prélèvement, et vous ne supporterez pas les coûts de transport du produit ou de la pièce détachée. Si vous ne retournez pas le produit ou la pièce remplacée comme indiqué ou si le produit ou la pièce remplacée ne remplit pas les conditions permettant de bénéficier du service de garantie, Apple débitera la carte de crédit du montant autorisé. (b) Service pour lequel Apple ne vous demande pas le retour du produit ou de la pièce remplacé(e). Apple vous enverra gratuitement une pièce ou un produit de remplacement avec, le cas échéant, les instructions d’installation, ainsi que toutes les conditions pour le traitement du produit ou de la pièce remplacé(e). (c) Apple n’est responsable d’aucun coût de main d’œuvre que vous pourriez supporter en relation avec le service DIY. Si vous avez besoin d’une assistance particulière, merci de bien vouloir contacter Apple au numéro de téléphone indiqué ci-dessous. Apple se réserve le droit de modifier les moyens par lesquels Apple pourrait vous fournir le service de garantie ainsi que l’éligibilité de votre Produit Apple à une méthode de service en particulier. Le service de garantie sera limité aux options disponibles dans le pays où le service est demandé. Les options du service, la disponibilité des pièces et les délais de traitement varient en fonction des pays. Vous pourrez être tenu de payer les frais d’expédition et de transport si le Produit Apple ne peut pas être réparé dans le pays dans lequel il se trouve. Si vous demandez à bénéficier du service dans un pays qui n’est pas le pays d’achat, vous devrez vous conformer à toutes les lois applicables relatives à l’importation et à l’exportation et serez redevable des droits de douane, de la TVA et toutes autres taxes et coûts informations personnelles que vous souhaitez protéger ainsi qu’à désactiver tous vos mots de passe. IL EST POSSIBLE QUE LE CONTENU DU SUPPORT DE STOCKAGE DE VOTRE PRODUIT APPLE SOIT PERDU REMPLACE OU REFORMATE LORS DE LA MISE EN OEUVRE DES SERVICES DE GARANTIE. DANS UNE TELLE HYPOTHESE, APPLE ET SES REPRESENTANTS NE SERONT PAS RESPONSABLE DE LA PERTE DES LOGICIELS, DONNEES OU AUTRES INFORMATIONS CONTENUES SUR LE SUPPORT DE STOCKAGE OU TOUTE AUTRE PARTIE DU PRODUIT APPLE REMIS. Votre Produit Apple, ou un Produit Apple de remplacement, vous sera retourné configuré tel que vous l’avez acheté, sous réserve des mises à jour applicables. Il vous appartiendra de réinstaller tous les autres logiciels, données et informations. La récupération et la réinstallation des autres programmes de logiciels, données et informations ne sont pas couvertes par cette garantie. QUE FERA APPLE EN CAS DE MISE EN OEUVRE DE LA GARANTIE ? Si une réclamation valable est reçue par Apple ou un PSAA pendant la Durée de la Garantie, Apple va, à son choix (i) réparer le Produit Apple en utilisant des pièces neuves ou des pièces dont les performances et la fiabilité sont équivalentes à celles d’une pièce neuve, ou (ii) échanger le Produit Apple avec un produit qui est au moins fonctionnellement équivalent au produit d’origine et qui est constitué de plusieurs pièces neuves ou de pièces dont les performances et la fiabilité sont équivalentes, ou (iii) rembourser le prix d’achat du Produit Apple. Apple pourra vous demander de remplacer certaines pièces ou certains produits pouvant être installés par l’utilisateur. Un produit ou une pièce de rechange, y compris une pièce pouvant être installée par l’utilisateur et qui aura été installée conformément aux instructions fournies par Apple, sera garantie pour la plus longue des durées suivantes : la durée restant à courir de la garantie du Produit Apple d’origine ou une durée de quatre-vingt dix (90) jours à compter de la date du remplacement ou de la réparation. Lorsqu’un produit ou une pièce est échangé(e) ou remboursé(e), toute pièce de rechange devient votre propriété et la pièce échangée ou remboursée devient la propriété d’Apple. COMMENT OBTENIR LE SERVICE DE GARANTIE? Apple fournira le service de garantie selon l’une des options suivantes : (i) Service sur place. Vous pouvez déposer votre Produit Apple dans un Magasin Apple ou chez un PSAA offrant un service sur place. Le service sera effectué sur place ou le Produit Apple pourra être envoyé par le Magasin Apple ou par le PSAA à un service de réparation Apple (“SRA”) afin d’être réparé. Une fois averti de la réparation de votre produit, vous devrez rapidement venir le récupérer auprès du Magasin Apple ou chez le PSAA, ou, le Produit Apple vous sera directement envoyé par le SRA. (ii) Service prêt à poster. Si Apple estime que votre Produit Apple peut être envoyé par courrier, Apple vous fera parvenir une enveloppe prépayée et si nécessaire, des matériaux Il répond également des défauts de conformité résultant de l’emballage, des instructions de montage ou de l’installation lorsque celle-ci a été mise à sa charge par le contrat ou a été réalisée sous sa responsabilité. » Article L. 211-5 du code de la consommation français « Pour être conforme au contrat, le bien doit : 1° Etre propre à l’usage habituellement attendu d’un bien semblable et, le cas échéant : - correspondre à la description donnée par le vendeur et posséder les qualités que celui-ci a présentées à l’acheteur sous forme d’échantillon ou de modèle ; - présenter les qualités qu’un acheteur peut légitimement attendre eu égard aux déclarations publiques faites par le vendeur, par le producteur ou par son représentant, notamment dans la publicité ou l’étiquetage ; 2° Ou présenter les caractéristiques définies d’un commun accord par les parties ou être propre à tout usage spécial recherché par l’acheteur, porté à la connaissance du vendeur et que ce dernier a accepté. » Article L. 211-12 du code de la consommation français « L’action résultant du défaut de conformité se prescrit par deux ans à compter de la délivrance du bien. » Article 1641 du code civil français « Le vendeur est tenu de la garantie à raison des défauts cachés de la chose vendue qui la rendent impropre à l’usage auquel on la destine, ou qui diminuent tellement cet usage que l’acheteur ne l’aurait pas acquise, ou n’en aurait donné qu’un moindre prix, s’il les avait connus.» Article 1648 alinéa 1er du code civil français « L’action résultant des vices rédhibitoires doit être intentée par l’acquéreur dans un délai de deux ans à compter de la découverte du vice. » RESPECT DE LA VIE PRIVEE Apple, en sa qualité de responsable de traitement, conservera et utilisera les informations du client conformément à la politique de confidentialité Apple, qui peut être consultée sur la page web suivante: www.apple.com/legal/warranty/privacy. STIPULATIONS GENERALES Aucun revendeur, agent ou salarié Apple n’est habilité à modifier, proroger ou compléter la présente garantie. Si une stipulation des présentes est déclarée illégale ou inapplicable, la validité des autres stipulations ne sera pas affectée. Cette garantie est régie et interprétée selon les lois du pays dans lequel le Produit Apple a été acheté. Apple est identifiée à la fin de ce document selon le pays dans lequel le Produit Apple a été acheté. Apple et ses successeurs sont les garants en vertu de cette garantie. associés. En ce qui concerne les services internationaux, Apple peut réparer ou échanger les produits ou les pièces par des produits ou pièces comparables conformes aux standards locaux. LIMITATION DE RESPONSABILITE A L’EXCEPTION DE CE QUI EST PREVU DANS LA PRESENTE GARANTIE COMMERCIALE ET DANS LA MESURE AUTORISEE PAR LA LOI, APPLE N’EST PAS RESPONSABLE DES DOMMAGES DIRECTS, SPÉCIFIQUES, ACCESSOIRES OU INDIRECTS, CONSECUTIFS OU NON, RESULTANT DE LA VIOLATION DE TOUTE GARANTIE OU RESPONSABILITE OU DE TOUT AUTRE CONCEPT JURIDIQUE, Y COMPRIS DE FACON NON LIMITATIVE TOUTE PERTE D’UTILISATION, PERTE DE REVENU, PERTE DE PROFITS REELS OU ANTICIPES (Y COMPRIS TOUTE PERTE DE PROFITS LIES A DES CONTRATS), PERTE DE DISPONIBILITE FINANCIERE, PERTE D’ECONOMIES PREVUES, PERTE D’AFFAIRES, PERTE D’OPPORTUNITES, PERTE DE CLIENTELE, DOMMAGE A LA REPUTATION, PERTE, DOMMAGE A, OU ENDOMMAGEMENT DE DONNEES, OU PERTE OU DOMMAGE INDIRECT OU CONSECUTIF, QUELLE QU’EN SOIT LA CAUSE, Y COMPRIS LE REMPLACEMENT DE MATERIELS OU DE BIENS, TOUS FRAIS DE RECUPERATION, DE PROGRAMMATION OU DE REPRODUCTION DE TOUT PROGRAMME OU DE TOUTE DONNEE STOCKEE OU UTILISEE AVEC LES PRODUITS APPLE ET TOUT ECHEC DANS LA PRESERVATION DE LA CONFIDENTIALITE DES DONNEES STOCKEES SUR LE PRODUIT APPLE. LA PRESENTE LIMITATION NE S’APPLIQUE PAS AUX RECLAMATIONS EN CAS DE DECES OU DE DOMMAGES CORPORELS OU EN CAS DE RESPONSABILITÉ LÉGALE POUR DOL OU FAUTE LOURDE ET/OU OMISSION. APPLE NE DONNE AUCUNE GARANTIE QUANT A SA CAPACITE A REPARER TOUT PRODUIT APPLE AUX TERMES DE LA PRESENTE GARANTIE NI A ECHANGER TOUT PRODUIT APPLE SANS AUCUN RISQUE NI AUCUNE PERTE DE PROGRAMME OU DE DONNEES. CERTAINS PAYS REGIONS, OU ETATS NE PERMETTENT PAS L’EXCLUSION OU LA LIMITATION DE RESPONSABILITE VIS-A-VIS DE CERTAINES CATEGORIES D’ACHETEURS TELS LES CONSOMMATEURS, DE TELLE SORTE QUE CERTAINES EXCLUSIONS ET LIMITATIONS PREVUES CI-DESSUS PEUVENT NE PAS S’APPLIQUER A VOUS. Nonobstant les stipulations de la présente garantie commerciale, Apple reste en toute hypothèse tenue, vis-à-vis des consommateurs, des défauts de conformité, dans les conditions prévues aux articles L. 211-1 et suivants du code de la consommation français et des vices rédhibitoires, dans les conditions prévues aux articles 1641 à 1649 du code civil français. Conformément aux dispositions de l’article L. 211-15 du code de la consommation français, les articles suivants s’appliquent aux consommateurs : Article L. 211-4 du code de la consommation français « Le vendeur est tenu de livrer un bien conforme au contrat et répond des défauts de conformité existant lors de la délivrance.Région/Pays d’achat Adresse Tous les pays Apple Distribution International Hollyhill Industrial Estate Hollyhill, Cork, Republic of Ireland ASIE/PACIFIQUE Australie ; Nouvelle Zélande, Fidji, PapouasieNouvelle- Guinée ; Vanuatu Apple Pty. Limited. PO Box A2629, Sydney South, NSW 1235, Australia Hong Kong Apple Asia Limited 2401 Tower One, Times Square, Causeway Bay; Hong Kong Inde Apple India Private Ltd. 19th Floor, Concorde Tower C, UB City No 24, Vittal Mallya Road, Bangalore 560-001, India Japon Apple Japan Inc. 3-20-2 Nishishinjuku, Shinjuku-ku, Tokyo, Japan Corée Apple Korea Ltd. 3201, ASEM Tower; 159, Samsung-dong, Gangnam-Gu; Seoul 135-798, Republic of Korea Afghanistan, Bangladesh, Bhoutan, Brunei, Cambodge Guam, Indonésie, Laos, Singapour, Malaisie, Népal, Pakistan, Philippines, Sri Lanka, Vietnam Apple South Asia Pte. Ltd. 7 Ang Mo Kio Street 64 Singapore 569086 République populaire de Chine Apple Computer Trading (Shanghai) Co. Ltd. Room 1815, No. 1 Jilong Road, Waigaoqiao Free Trade Zone, Shanghai 200131 China Thaïlande Apple South Asia (Thailand) Limited 25th Floor, Suite B2, Siam Tower, 989 Rama 1 Road, Pataumwan, Bangkok, 10330 Taiwan Apple Asia LLC 16A, No. 333 Tun Hwa S. Road. Sec. 2, Taipei, Taiwan 106 Autres pays d’Asie Pacifique Apple Inc. 1 Infinite Loop; Cupertino, CA 95014, U.S.A. 032212 Mac Warranty French v2 INFORMATION EN LIGNE De plus amples informations sont disponibles en ligne sur les sujets suivants : Information internationales de support www.apple.com/support/country Distributeurs agréés www.apple.com/buy Prestataire de Service Agréé Apple support.apple.com/kb/HT1434 Magasins Apple (“Apple Retail Store”) www.apple.com/retail/storelist/ Support et service Apple support.apple.com/kb/HE57 Support gratuit Apple www.apple.com/support/country/ index.html?dest=complimentary Societe Apple Garante Pour La Région Ou Le Pays D’achat Région/Pays d’achat Adresse AMÉRIQUE Brésil Apple Computer Brasil Ltda Av. Cidade Jardim 400, 2 Andar, Sao Paulo, SP Brasil 01454-901 Canada Apple Canada Inc. 7495 Birchmount Rd.; Markham, Ontario, Canada; L3R 5G2 Canada Mexique Apple Operations Mexico, S.A. de C.V. Prolongación Paseo de la Reforma #600, Suite 132, Colonia Peña Blanca, Santa Fé, Delegación Álvaro Obregón, México D. F., CP 01210, Mexico Etats-Unis et autres pays d’Amérique Apple Inc. 1 Infinite Loop; Cupertino, CA 95014, U.S.A. EUROPE, MOYEN-ORIENT ET AFRIQUE© 2012 Apple Inc. Tous droits réservés. Apple, le logo Apple, AirPort Extreme, iPod, Mac, MacBook et MagSafe sont des marques d’Apple Inc., déposées aux États-Unis et dans d’autres pays. Apple Store et AppleCare sont des marques de service d’Apple Inc. déposées aux États-Unis et dans d’autres pays. La marque et les logos Bluetooth® sont la propriété de Bluetooth SIG, Inc. et sont concédés sous licence par Apple Inc. ENERGY STAR® est une marque déposée aux États-Unis. F034-6359-A Printed in XXXX Pushing the Limits of Hardware The Mac Pro, which was first introduced in 2006, has evolved over the years to take in account the requirements of the creative community around the world, driving hardware trends such as multiprocessor architectures, graphics performance and expansion. Combined with Leopard, the latest release of Mac OS X, the new Mac Pro continues to redefine the creative work environment. Over the years, creative workflows have evolved considerably, moving from mainly print-centric production environments to multiple media and increasingly diverse output channels. While five or ten years ago, the separation between different disciplines were relatively clear-cut, the same is not true any more today. In many cases, the same creative professionals who work on display advertisements, for instance, will also have to tackle interactive content, digital video, web development, 3D rendering and audio production. As a result, the hardware requirements for the creative workstation have grown dramatically in terms of media diversity as well as concerning quantity and size of the files that need to be managed and processed. About this Report This report analyzes the results of a benchmark project conducted by Pfeiffer Consulting for Apple, comparing performance and workflow productivity of the 8-core 2.8GHz and 3.2GHz Mac Pro introduced in early 2008 with earlier Macintosh models including the dual 2.0GHz Power Mac G5, the Power Mac G5 Quad, as well as the previous generation Mac Pro. To find out more about the benchmarks and hardware configurations, please refer to the Methodology sidebar on page 3. The project included system benchmarks as well as performance and productivity measures conducted with Adobe Creative Suite 3 as well as QuarkXPress 7.3.1. Productivity benchmarks cover workflow productivity and inter-application integration measures. In addition, this report takes a closer look at the hardware differences between the latest Mac Pro and previous versions of the Mac Pro family. (See page 6.) If you are interested in a detailed discussion of hardware configurations and benchmark methodology, as well as complete results of all benchmarks, please download the complete Mac Pro 2008 Benchmark Report at www.pfeifferreport.com. Major Findings • The 2008 Mac Pro provides an optimized hardware platform with increased hardware performance and greater memory bandwidth than earlier models. • Based on the benchmarks conducted for this project, the 2008 Mac Pro offers a clear increase in performance and productivity over the previous generation Mac Pro and older Macintosh computers. • The 2008 Mac Pro brings extended multiprocessing architectures to the mainstream by providing eight processing cores in almost all configurations. About Pfeiffer Consulting • Pfeiffer Consulting is an independent technology research institute and consulting operation focused on the needs of publishing, digital content production, and new media professionals. • Download the complete Mac Pro 2008 Benchmark Report at www.pfeifferreport.com. Pfeiffer Report • Benchmark Analysis Pfeiffer Consulting 01001011 Mac Pro 2008: Performance and Productivity for Creative Pros Productivity and workflow efficiency of the 2008 Mac Pro with the Adobe Creative Suite 3 and QuarkXPress 7 © Pfeiffer Consulting 2008 Mac Pro 2008: Performance and Productivity for Creative Pros 1Performance vs. Productivity Performance and productivity are completely different notions and rely on different aspects of a computing platform. Processor frequency, memory speed and bandwidth, disk performance, graphics architecture, and, of course, the operating system all play together to deliver a satisfying and efficient user experience. Only if all hardware and software components work together in an optimal way can we expect maximum efficiency and productivity. In other words, number-crunching prowess is not the only factor that counts. A computer can be very powerful at complex computations such as 3D rendering, yet deliver a poor overall productivity profile. It is for this reason that the benchmarks conducted for this project are comprised of a wide variety of tests and efficiency measures ranging from aspects such as application launch and file copy to pure performance measures of cutting-edge applications such as Photoshop CS3, as well as workflow productivity measures of common tasks. How Does the Latest Mac Pro Stack Up? The benchmarks conducted for this report compare the 8-core 2.8GHz and 3.2GHz Mac Pro released in early 2008 with the previous generation Mac Pro, as well as older Power Mac models. The test results clearly show the increase in performance that the new hardware platform procures. Major Points • Based on the benchmarks conducted for this project, the Mac Pro released in early 2008 represents a highly optimized computing platform that increases performance and productivity over previous Macintosh models. • The 2008 Mac Pro offers a clear increase in performance over the previous generation Mac Pro, the Power Mac G5 and older Macintosh computers in basic system benchmarks, as well as in application-based performance measures. • Efficiency of key applications such as Photoshop CS3 is significantly better on the latest Mac Pro than on older models. Photoshop CS3 Performance (Total Time) Time scale in seconds. Shorter is better. 49.67 57.97 47.50 52.97 0 50 100 150 200 250 300 350 400 Mac Pro 2008 (3.2GHz) Mac Pro 2008 (2.8GHz) Mac Pro 3.0GHz (8-core Xeon) Mac Pro 3.0GHz (4-core Xeon) Power Mac G5 Quad Power Mac G5 (2.0GHz) Mac Pro 3.0GHz (8-core Xeon) Mac Pro 3.0GHz (quad-core Xeon) Mac Pro 2008 (3.2GHz) Mac Pro 2008 (2.8GHz) Power Mac G5 Quad Power Mac G5 (2.0GHz) 6 min 07 sec 3 min 56 sec 59.59 2 min 54 sec 2 min 41 sec 2 min 35 sec 2 min 19 sec 6 min 07 sec 3 min 56 sec 2 min 54 sec 2 min 41 sec 2 min 35 sec 2 min 19 sec Mac Pro 3.0GHz 8-core first gen. Mac Pro 3.0GHz quad-core first gen. Mac Pro 2008 3.2GHz 8-core Mac Pro 2008 2.8GHz 8-core Power Mac G5 Quad Power Mac G5 2.0GHz All Workflow Benchmarks (Total Time) Time scale in seconds. Shorter is better. 49.67 57.97 47.50 52.97 0 100 200 300 400 500 600 0 100 200 300 400 500 600 Mac Pro 2008 (3.2GHz) Mac Pro 2008 (2.8GHz) Mac Pro 3.0GHz (8-core Xeon) Mac Pro 3.0GHz (4-core Xeon) Power Mac G5 Quad Power Mac G5 (2.0GHz) Mac Pro 3.0GHz (8-core Xeon) Mac Pro 3.0GHz (quad-core Xeon) Mac Pro 2008 (3.2GHz) Mac Pro 2008 (2.8GHz) Power Mac G5 Quad Power Mac G5 (2.0GHz) 9 min 29 sec 8 min 06 sec 59.59 6 min 18 sec 6 min 04 sec 5 min 55 sec 5 min 19 sec 6 min 07 sec 3 min 56 sec 2 min 54 sec 2 min 41 sec 2 min 35 sec 2 min 19 sec Mac Pro 3.0GHz 8-core first gen. Mac Pro 3.0GHz quad-core first gen. Mac Pro 2008 3.2GHz 8-core Mac Pro 2008 2.8GHz 8-core Power Mac G5 Quad Power Mac G5 2.0GHz Mac Pro 2008: Key Performance and Productivity Data Performance increases in frequently performed, time-consuming operations are very important in deadline-driven work environments. The chart on the left shows the cumulative time of all Photoshop performance benchmarks in this benchmark project, including common operations such as unsharp masking, resampling and image rotation performed with files of varying sizes. The chart on the right shows the cumulated time of all workflow benchmarks. Both sets of data underline the performance and productivity increase of the latest generation Mac Pro over older Macintosh models. Mac Pro: Key Performance Data © Pfeiffer Consulting 2008 2 Mac Pro 2008: Performance and Productivity for Creative ProsIt is interesting to note that despite a relatively modest increase in processor speed the 2008 Mac Pro is clearly faster than the previous generation Mac Pro. Compared with older models such as the Power Mac G5 Quad, it is almost twice as fast in many tests. A good example for this is the Photoshop Filter Index benchmark. Different Photoshop filters draw upon varying hardware aspects; for example, some use mainly floating point calculations, others rely on integer performance, yet others mainly on memory bandwidth. This makes the Photoshop Filter Index a good indicator of the overall performance of a computer. The 3.2GHz Mac Pro performed significantly better than older models, scoring 0.72 seconds per filter, compared with 0.80 seconds for 3.0 GHz 8-core Mac Pro released in 2007. In other words, the Mac Pro hardware platform keeps evolving at a significant pace, and shows coherent performance and productivity increases over previous models. Combined with the Adobe Creative Suite 3 and QuarkXPress 7.3.1, the 8-core 2.8GHz and 3.2GHz Mac Pro offer a measurably faster and more productive hardware platform than older Macintosh models, and contribute to redefining the creative workflow in terms of efficiency and performance. This report was created by Pfeiffer Consulting (http://www.pfeifferconsulting.com). Reproduction prohibited without prior written permission. For further information, please contact research@pfeifferreport.com. Adobe, Illustrator, InDesign, and Photoshop are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries. Apple, the Apple logo, Mac, Macintosh, Mac OS, Mac Pro and Power Mac are trademarks of Apple, Inc., registered in the United States and other countries. PowerPC is a trademark of International Business Machines Corporation, used under license therefrom. All other trademarks are the property of their respective owners. The Photoshop Filter Index benchmark measures the time necessary to compute 103 Photoshop filters in succession on a 10MB image file. The times displayed in this chart show the average time per filter. Basic system benchmarks measure the time necessary for frequent system tasks such as application launch and re-launch. The 2008 Mac Pro is clearly more efficient in these tests: the 3.2GHz model is almost twice as fast as the 2.0GHz Power Mac G5. 49.67 57.97 47.50 52.97 0 30 60 90 120 150 Mac Pro 2008 (3.2GHz) Mac Pro 2008 (2.8GHz) Mac Pro 3.0GHz (8-core Xeon) Mac Pro 3.0GHz (4-core Xeon) Power Mac G5 Quad Power Mac G5 (2.0GHz) 59.59 2 min 19 sec 2 min 02 sec 1 min 30 sec 1 min 26 1 min 21 sec 1 min 17 sec Mac Pro 3.0GHz 8-core first gen. Mac Pro 3.0GHz quad-core first gen. Mac Pro 2008 3.2GHz 8-core Mac Pro 2008 2.8GHz 8-core Power Mac G5 Quad Power Mac G5 2.0GHz Basic System Tests (Total Time) Time scale in seconds. Shorter is better. 0.0 0.5 1.0 1.5 2.0 Mac Pro 2008 (3.2GHz) Mac Pro 2008 (2.8GHz) Mac Pro 3.0GHz (8-core Xeon) Mac Pro 3.0GHz (4-core Xeon) Power Mac G5 Quad Power Mac G5 (2.0GHz) Photoshop Filter Index (Average) Time scale in seconds. Shorter is better. 1.76 1.25 0.85 0.80 0.82 0.72 Mac Pro 3.0GHz 8-core first gen. Mac Pro 3.0GHz quad-core first gen. Mac Pro 2008 3.2GHz 8-core Mac Pro 2008 2.8GHz 8-core Power Mac G5 Quad Power Mac G5 2.0GHz © Pfeiffer Consulting 2008 Mac Pro 2008: Performance and Productivity for Creative Pros 3 Methodology • This benchmark project was conducted by Pfeiffer Consulting for Apple. It analyzes the performance and productivity of the 8-core 2.8GHz and 3.2GHz Mac Pro released in early 2008, as compared with the quadcore and 8-core 3.0GHz Mac Pro released in 2006 and 2007, the 2.5GHz Power Mac G5 Quad, released in the Fall of 2005, the first-generation dual 2.0GHz Power Mac G5 introduced in 2003 and the dual 1.25GHz Power Mac G4 introduced in 2002. • Productivity benchmarks were conducted using a set of workflow and application integration measures executed with Adobe Creative Suite 3 and QuarkXPress 7.3.1. • Benchmarks were conducted on standard hardware configurations. All computers were equipped with 4GB of RAM. The Power Mac G4 was equipped with 2GB of RAM, the maximum amount of RAM supported by this model. • All systems were equipped with the standard hard drives shipped with the computer. All hard drives were reformatted using a single partition before testing. • All benchmarks were run on a standard, unmodified installation of Mac OS X 10.5.1 Leopard. • This benchmark analysis report presents key data from the benchmark project and focuses on the comparison of the Mac Pro with two generations of Power Mac G5. To view the complete results, including the data concerning the dual 1.25GHz Power Mac G4 introduced in 2002, as well as descriptions of the benchmark methodology, and detailed system configurations, please download the complete benchmark report from http://www.pfeifferreport.com. • For more information, please contact research@pfeifferreport.com.An Increasingly Complex Work Environment Over the years, creative workflows have become increasingly complex. Designers now have to routinely handle a variety of different media types, as assignments span a growing number of potential output channels for content and media. Even seemingly straightforward market segments such as digital imaging have reached a level of maturity that requires a set of sophisticated and diversified tools. As different media types are increasingly interconnected, the sophistication and the complexity of the workflow-reality creative professionals face in their average project has evolved dramatically. As a result, efficiency has to some extent displaced features as the main driver for tool adoption. As everyday deadline pressure increases, productivity has become a predominant concern for creative professionals around the globe. The Challenges The size of the files we create and use has grown enormously over the years, image files can easily weigh several hundred megabytes, a complete project can take several gigabyte of data. And size is not the only issue, we also have a seemingly ever-increasing number of documents we need to manage, store, open, sort and access. And all of this needs to be done as fast as possible. Major Points • Creative workflows have become extremely complex over the years: The size of the files that are commonly used has grown considerably, and the number of documents in the typical project has soared. This has created a number of new processing and management challenges for users. • In all workflow benchmarks conducted for this project, the 2008 Mac Pro offers clear productivity advantages over older Macintosh models. • The 3.2GHz Mac Pro offers clearly increased performance and productivity over the 2.8GHz model, and is up to 3 times faster than the 2.0GHz Power Mac G5. InDesign CS3 Workflow Benchmarks: Total Time Time scale in seconds. Shorter is better. 49.67 57.97 47.50 52.97 0 50 100 150 200 Mac Pro 2008 (3.2GHz) Mac Pro 2008 (2.8GHz) Mac Pro 3.0GHz (8-core Xeon) Mac Pro 3.0GHz (4-core Xeon) Power Mac G5 Quad Power Mac G5 (2.0GHz) 59.59 2 min 59 sec 2 min 20 sec 1 min 46 sec 1 min 41 sec 1 min 39 sec 1 min 27 sec Mac Pro 3.0GHz 8-core first gen. Mac Pro 3.0GHz quad-core first gen. Mac Pro 2008 3.2GHz 8-core Mac Pro 2008 2.8GHz 8-core Power Mac G5 Quad Power Mac G5 2.0GHz QuarkXPress 7.3.1 Workflow Benchmarks: Total Time Time scale in seconds. Shorter is better. 49.67 57.97 47.50 52.97 0 50 100 150 200 250 300 Mac Pro 2008 (3.2GHz) Mac Pro 2008 (2.8GHz) Mac Pro 3.0GHz (8-core Xeon) Mac Pro 3.0GHz (4-core Xeon) Power Mac G5 Quad Power Mac G5 (2.0GHz) 59.59 4 min 48 sec 4 min 16 sec 3 min 09 sec 3 min 08 sec 3 min 03 sec 2 min 46 sec Mac Pro 3.0GHz 8-core first gen. Mac Pro 3.0GHz quad-core first gen. Mac Pro 2008 3.2GHz 8-core Mac Pro 2008 2.8GHz 8-core Power Mac G5 Quad Power Mac G5 2.0GHz Design Workflow: InDesign CS 3 and QuarkXPress 7.3.1 Design workflow benchmarks measured a variety of common workflow steps and procedures, such as the time to execute a Photoshop round-trip between a page layout program and the imaging application. Results for these tests show the speed of the applications as well as the fluidity of the inter-application integration. Both Mac Pro models introduced in 2008 were clearly more efficient in these tests than older Macintosh computers. Tests were conducted with InDesign CS3, QuarkXPress 7.3.1, Photoshop CS3 and Illustrator CS3. Workflow Productivity For Creative Professionals © Pfeiffer Consulting 2008 4 Mac Pro 2008: Performance and Productivity for Creative ProsAbout the Workflow Benchmarks The workflow efficiency measures conducted for this benchmark project included a variety of common steps and workflow sequences frequently encountered in creative workflows. Workflow integration benchmarks covered the time necessary to perform a roundtrip between a page layout application (InDesign or QuarkXPress) and graphics applications such as Photoshop CS3 and Illustrator CS3, measuring the time necessary to switch between programs, open a file, apply a simple modification, save the changes, and switch back to update the design document. The Basic Imaging Workflow benchmark focuses on efficiency within Photoshop CS3, and measures the time necessary to open a file, resample it to a specific size, apply RGB to CMYK color conversion, perform an Unsharp Mask filter, and save the file under another name. Workflow efficiency measures include the time necessary for the operator to perform menu selection and other user interface operations required to complete the tasks. This means that workflow benchmarks cover not only program efficiency, but also measure overall fluidity of the computing environment. The Importance of Integration Integration is one of the most important aspects of workflow productivity on any computer: Most creative professionals use a variety of different tools together, rather than individually, moving back and forth between several applications. In this process, the fluidity and speed of integration is at least as important as the processing speed of one particular program. So how does the Mac Pro compare with older Macintosh models in productivity measures where the complexity of the individual task is not the predominant factor? The workflow benchmarks conducted for this project show that the 2008 Mac Pro is clearly more productive than previous Mac Pro models. For example, the 3.2GHz Mac Pro managed to complete the Basic Imaging Workflow Benchmark in just over 1 min. 5 seconds. By comparison, the 3.0GHz Mac Pro introduced in 2007 took 17% longer for the same test; the Power Mac G5 Quad, the fastest PowerPC-based Macintosh ever produced, required almost 40% longer to complete the same benchmark. (See chart below.) Rotate Canvas (300MB Multi-Layered File) Time scale in seconds. Shorter is better. 34.37 22.95 10.84 7.86 7.23 49.67 57.97 47.50 52.97 0 5 10 15 20 Mac Pro 2008 (3.2GHz) Mac Pro 2008 (2.8GHz) Mac Pro 3.0GHz (8-core Xeon) Mac Pro 3.0GHz (4-core Xeon) Power Mac G5 Quad Power Mac G5 (2.0GHz) 59.59 17.90 9.93 8.01 7.01 6.27 5.70 Mac Pro 3.0GHz 8-core first gen. Mac Pro 3.0GHz quad-core first gen. Mac Pro 2008 3.2GHz 8-core Mac Pro 2008 2.8GHz 8-core Power Mac G5 Quad Power Mac G5 2.0GHz RAW Conversion (10 x 13MP File) Time scale in seconds. Shorter is better. 34.37 22.95 10.84 7.86 7.23 49.67 57.97 47.50 52.97 0 10 20 30 40 50 60 70 80 Mac Pro 2008 (3.2GHz) Mac Pro 2008 (2.8GHz) Mac Pro 3.0GHz (8-core Xeon) Mac Pro 3.0GHz (4-core Xeon) Power Mac G5 Quad Power Mac G5 (2.0GHz) 59.59 1 min 05 sec 40.56 29.45 27.31 25.37 23.44 Mac Pro 3.0GHz 8-core first gen. Mac Pro 3.0GHz quad-core first gen. Mac Pro 2008 3.2GHz 8-core Mac Pro 2008 2.8GHz 8-core Power Mac G5 Quad Power Mac G5 2.0GHz Basic Imaging Workflow This benchmark measures the time necessary to complete a set of basic image processing operations common in design and publishing workflows. 49.67 57.97 47.50 52.97 0 20 40 60 80 100 120 Mac Pro 2008 (3.2GHz) Mac Pro 2008 (2.8GHz) Mac Pro 3.0GHz (8-core Xeon) Mac Pro 3.0GHz (4-core Xeon) Power Mac G5 Quad Power Mac G5 (2.0GHz) 59.59 1 min 42 sec 1 min 31 sec 1 min 22 sec 1 min 15 sec 1 min 13 sec 1 min 05 sec Mac Pro 3.0GHz 8-core first gen. Mac Pro 3.0GHz quad-core first gen. Mac Pro 2008 3.2GHz 8-core Mac Pro 2008 2.8GHz 8-core Power Mac G5 Quad Power Mac G5 2.0GHz Basic Imaging Workflow Benchmark (Total Time) Time scale in seconds. Shorter is better. Photoshop Expert Options Photoshop is one of the most widely used software package for creative professionals, and offers a considerable breadth of features targeting a wide variety of users. Some of these specialized options have become the backbone of specific creative workflows, and their efficiency can have a strong impact on the overall productivity. Several such actions or tasks (such as manipulating complex, multi-layered image files, or the conversion of increasingly widely used Raw files from digital cameras) were covered in this benchmark project. The charts show individual results for two of these tests. © Pfeiffer Consulting 2008 Mac Pro 2008: Performance and Productivity for Creative Pros 5Looking Beyond Processor Speed The results of this benchmark project underline a long-term trend in the personal computer industry: Performance and productivity of a hardware platform rely of course on the clock-speed of the central processors, but increasingly also on other hardware aspects such as memory bandwidth, system bus speed, L2 cache, mass storage architecture, and graphics subsystem among many others. Sophisticated operating system support for advanced hardware features such as multiple processor cores is also essential to optimize productivity. The Mac Pro introduced in early 2008 is a case in point. At 3.2GHz, the processor speed of the new high-end configuration is only slightly increased over the previous top-of-the-line model, the 3.0 GHz 8-core Mac Pro released a year earlier, yet performance and productivity are clearly and consistently superior on the newer model, as the benchmark results from this report show. In other words, improvements across the entire system architecture are delivering greater performance and capabilities to the end user. The new Mac Pro benefits from increased L2 cache (a total of 12MB, or 6MB of shared L2 cache per pair of cores), as well as the fastest Xeon architecture available, which includes 1600MHz independent frontside buses and 800MHz FB-DIMM memory, that allow significantly greater memory throughput. Plus, the 2008 Mac Pro extents the capabilities of the platform in terms of expansion capabilities as well as concerning key hardware features with advanced graphics options from both ATI and NVIDIA, up to 4TB of internal storage, and high-performance storage options with 15,000rpm SAS drives and the Mac Pro RAID card. Together, these hardware improvements contribute to make the new model an important evolution of the hardware platform over previous models, and ensure that the Mac Pro can tackle the challenges of the modern creative workflow. Major Points • Performance and productivity of a hardware platform rely increasingly on the perfect integration of a variety of different hardware aspects. • The Mac Pro introduced in early 2008 offers significantly improved memory throughput over older models. • By moving the majority of configurations to 8-core processors, the 2008 Mac Pro brings extended multiprocessing architectures to the mainstream. In addition, Mac OS X Leopard provides increased support for multiprocessing. Processing Two 2.8GHz, 3.0GHz or 3.2GHz Quad-Core Intel Xeon 5400 Series (“Harpertown”) processors or one 2.8GHz Quad-Core Intel Xeon 5400 Series processor L2 Cache: 12MB per quad-core processor (6MB shared per pair of cores) 128-bit SSE4 vector engine 64-bit data paths and registers 1600MHz, 64-bit dual independent frontside buses Memory 800MHz DDR2 ECC FB-DIMM memory 256-bit-wide memory architecture 8 FB-DIMM slots, for up to 32GB of fully buffered memory Graphics and displays Double-wide 16-lane PCI Express 2.0 slot (Supports two 30-inch Apple Cinema HD displays) Storage Four 3.5-inch hard drive bays on independent 3Gb/s Serial ATA channels Up to 4TB of internal storage Optional 15,000 RPM SAS (serial attached SCSI) drives and Mac Pro RAID card Mac Pro 2008 Hardware Highlights Evolutions of the Hardware Platform © Pfeiffer Consulting 2008 6 Mac Pro 2008: Performance and Productivity for Creative Pros iPod shuffle Manuale utenteContenuto 3 Capitolo 1:  Informazioni su iPod shuffle 3 Novità di iPod shuffle 4 Capitolo 2:  Nozioni di base di iPod shuffle 4 Panoramica di iPod shuffle 5 Utilizzare i controlli di iPod shuffle 5 Collegare e scollegare iPod shuffle 7 Informazioni sulla batteria di iPod shuffle 9 Capitolo 3:  Configurazione di iPod shuffle 9 Informazioni su iTunes 10 Configurare la libreria di iTunes 11 Organizzare la musica 11 Collegare iPod shuffle a un computer per la prima volta 12 Aggiungere musica a iPod shuffle 17 Capitolo 4:  Ascoltare musica 17 Riprodurre musica 18 Utilizzare VoiceOver 20 Impostare le tracce per la riproduzione allo stesso livello di volume 21 Impostare un limite di volume 21 Bloccare e sbloccare i pulsanti di iPod shuffle 22 Capitolo 5:  Archiviare file su iPod shuffle 22 Utilizzare iPod shuffle come disco esterno 24 Capitolo 6:  Suggerimenti e risoluzione dei problemi 26 Aggiornare e ripristinare il software di iPod shuffle 28 Capitolo 7:  Sicurezza e pulizia 28 Informazioni di sicurezza importanti 29 Informazioni importanti per un corretto utilizzo 31 Capitolo 8:  Altre informazioni, servizi e supporto 32 Informazioni sulla conformità alle normative     21 3 Congratulazioni per aver acquistato iPod shuffle. ATTENZIONE: Per evitare lesioni, leggi Capitolo 7, Sicurezza e pulizia, a pagina 28 prima di utilizzare iPod shuffle. Per utilizzare iPod shuffle, trasferisci brani e altri file audio sul computer, quindi sincronizzali con iPod shuffle. Utilizza iPod shuffle per: • Sincronizzare brani e playlist da ascoltare in viaggio. • Ascoltare podcast, programmi in stile radiofonico scaricabili, disponibili su Internet. • Ascoltare audiolibri acquistati su iTunes Store o su audible.com • Archiviare o effettuare una copia di backup di file e altri dati usando iPod shuffle come disco esterno. Novità di iPod shuffle • Tasto VoiceOver che pronuncia i titoli delle tracce e i nomi degli artisti, ti consente di cambiare playlist e ti informa sullo stato della batteria • Controlli semplici e intuitivi • Supporto per la sincronizzazione dei mix Genius • Supporto per la sincronizzazione di raccolte iTunes U Informazioni su iPod shuffle2 4 Leggi le informazioni riportate in questo capitolo per maggiori informazioni sulle funzionalità di iPod shuffle, per imparare a usare i controlli e altro ancora. Il pacchetto di iPod shuffle include iPod shuffle, gli auricolari Apple e un cavo USB 2.0 per collegare iPod shuffle al computer. Panoramica di iPod shuffle Luce di stato Porta auricolari Precedente/Riavvolgi Riproduci/Metti in pausa Volume giù Pulsante VoiceOver Interruttore a tre vie Volume su Clip Successivo/Vai avanti velocemente Per utilizzare gli auricolari Apple: m Collega gli auricolari alla porta auricolari di iPod shuffle. Quindi, posiziona gli auricolari nelle orecchie come mostrato in figura. Il cavo auricolari è regolabile. ATTENZIONE: Prima di usare Informazioni di sicurezza importanti a pagina 28, leggi tutte le informazioni di sicurezza in iPod shuffle per evitare danni all'udito. Puoi acquistare altri accessori, come gli auricolari Apple con telecomando e microfono e gli auricolari Apple In-Ear con telecomando e microfono, sul sito www.apple.com/it/ipodstore. La funzionalità microfono non è supportata da iPod shuffle. Nozioni di base di iPod shuffleCapitolo  2    Nozioni di base di iPod shuffle 5 Utilizzare i controlli di iPod shuffle I controlli anteriori, il tasto di VoiceOver e l'interruttore a tre posizioni rendono semplice la riproduzione di brani, audiolibri, podcast audio e raccolte di iTunes U su iPod shuffle. Per Esegui questa operazione Accendere o spegnere iPod shuffle Fai scorrere l'interruttore a tre posizioni (un'ombreggiatura verde sull'interruttore indica che iPod shuffle è acceso). Riprodurre o mettere in pausa Premi Play/Pausa (’). Ridurre o aumentare il volume Premi Volume su (∂) o Volume giù (D). Tieni premuti i tasti per aumentare o diminuire rapidamente il volume. Impostare l'ordine di riproduzione Fai scorrere l'interruttore a tre posizioni per riprodurre in ordine (⁄) o riprodurre in ordine casuale (¡). Passare alla traccia successiva Premi Successivo/Avanza velocemente (‘). Passare alla traccia precedente Premi Precedente/Riavvolgi (]) entro sei secondi dall'inizio della traccia. Dopo 6 secondi, premendo Precedente/Riavvolgi (]) la traccia attuale ricomincia. Avanti velocemente Tieni premuto Successivo/Avanza velocemente (‘). Riavvolgere Tieni premuto Precedente/Riavvolgi (]). Sentire il nome dell'artista e il titolo della traccia Premi il tasto di VoiceOver ( ). Sentire un menu delle playlist fra cui scegliere Tieni premuto il tasto di VoiceOver ( ). Premi Successivo/Avanza velocemente (‘) o Precedente/ Riavvolgi (]) per spostarti attraverso il menu delle playlist. Premi il tasto VoiceOver ( ) o Play/Pausa (’) per selezionare una playlist. Tieni premuto di nuovo il tasto di VoiceOver ( ) per uscire senza selezionare nulla. Bloccare i pulsanti di iPod shuffle (per evitare che si attivino se li premi accidentalmente) Tieni premuto Play/Pausa (’) fino a quando la spia di stato non lampeggia tre volte in arancione. Ripeti per sbloccare i pulsanti. Reimpostare iPod shuffle (se iPod shuffle non risponde o la spia di stato è di colore rosso fisso) Spegni iPod shuffle, attendi 10 secondi, quindi riaccendilo. Trovare il numero di serie di iPod shuffle Cerca sotto il clip di iPod shuffle. Oppure in iTunes (con iPod shuffle collegato al computer), seleziona iPod shuffle nell'elenco dei dispositivi e fai clic sul pannello Riepilogo. Collegare e scollegare iPod shuffle Collega iPod shuffle al computer per sincronizzare brani e altri file audio e per caricare la batteria. Quando hai terminato, scollega iPod shuffle. Importante: Per collegare iPod shuffle al computer, usa soltanto il cavo USB 2.0 fornito con iPod shuffle.Capitolo  2    Nozioni di base di iPod shuffle 6 Collegare iPod shuffle Per collegare iPod shuffle al computer: m Inserisci un'estremità del cavo USB incluso nella porta degli auricolari di iPod shuffle e l'altra estremità in una porta USB 2.0 ad alta potenza del computer. Nota: Non collegare iPod shuffle ad una delle porte USB della tastiera per la caricarlo. Un cavo USB più lungo è in vendita separatamente su www.apple.com/it/ipodstore. La prima volta che colleghi iPod shuffle al computer, iTunes ti aiuta a configurare e a sincronizzare iPod shuffle con la libreria iTunes. Di default, iTunes sincronizza automaticamente i brani su iPod shuffle quando lo colleghi al computer. Puoi sincronizzare i brani mentre la batteria è in carica. Se colleghi iPod shuffle a un altro computer e iPod shuffle è impostato per la sincronizzazione automatica della musica, iTunes ti avviserà prima di effettuare la sincronizzazione. Se fai clic su Sì, i brani e gli altri file audio presenti su iPod shuffle verranno cancellati e sostituiti con i brani e i file audio presenti sul computer al quale iPod shuffle è stato collegato. Per informazioni su come aggiungere musica a iPod shuffle o su come utilizzare iPod shuffle con più computer, consulta Capitolo 4, Ascoltare musica, a pagina 17. Scollegare iPod shuffle È importante non scollegare iPod shuffle dal computer mentre stai caricando file audio o quando usi iPod shuffle come disco esterno. È possibile scollegare iPod shuffle quando l'indicatore luminoso di stato non lampeggia in arancione o quando visualizzato il messaggio “OK per scollegare” nella parte superiore della finestra di iTunes. Importante: Se vedi il messaggio “Non scollegare” in iTunes o se l'indicatore luminoso di stato di iPod shuffle lampeggia in arancione, devi espellere iPod shuffle prima di scollegarlo. In caso contrario, potresti danneggiare i file presenti su iPod shuffle e sarà necessario ripristinare iPod shuffle in iTunes. Per informazioni sul ripristino, consulta Aggiornare e ripristinare il software di iPod shuffle a pagina 26. Se abiliti iPod shuffle per l'uso come disco (consulta Utilizzare iPod shuffle come disco esterno a pagina 22), devi sempre espellere iPod shuffle prima di scollegarlo. Per espellere iPod shuffle: m In iTunes, fai clic sul pulsante Espelli (C) accanto a iPod shuffle nell'elenco dei dispositivi. Se utilizzi un computer Mac, puoi anche espellere  iPod shuffle trascinando l'icona di iPod shuffle dalla scrivania sul Cestino. Se utilizzi un PC Windows, puoi anche espellere  iPod shuffle in Risorse del computer o facendo clic sull'icona di rimozione sicura dell'hardware, nella barra di sistema di Windows, e selezionando iPod shuffle.Capitolo  2    Nozioni di base di iPod shuffle 7 Per scollegare iPod shuffle: m Scollega il cavo USB da iPod shuffle e dal computer. Informazioni sulla batteria di iPod shuffle iPod shuffle dispone di una batteria ricaricabile che deve essere sostituita soltanto da un fornitore di servizi Apple autorizzato. Per ottimizzare la durata della batteria, la prima volta che utilizzi iPod shuffle, ricarica completamente la batteria per circa tre ore. La batteria si carica all'80 percento in circa due ore e si carica completamente in circa tre ore. Se non utilizzi iPod shuffle per qualche tempo, potresti dover ricaricare la batteria. Mentre la batteria è in carica, puoi continuare a sincronizzare la musica. Puoi scollegare e utilizzare iPod shuffle anche prima che l'operazione di ricarica sia completata. Ricaricare la batteria di iPod shuffle Puoi caricare la batteria di iPod shuffle in due modi: • Collega iPod shuffle al computer. • Usa l'adattatore di alimentazione USB di Apple, in vendita separatamente. Per caricare la batteria utilizzando il computer: m Collega iPod shuffle a una porta USB 2.0 ad alta potenza sul computer utilizzando il cavo USB fornito con iPod shuffle. Il computer dev'essere acceso e non in stop (alcuni modelli di Mac possono caricare iPod shuffle anche durante lo stop). Quando la batteria è in carica, l'indicatore luminoso di stato di iPod shuffle è arancione fisso. Quando la batteria è interamente carica, la spia di stato è verde. In iTunes, l'icona della batteria accanto al nome di iPod shuffle mostra lo stato della batteria. L'icona mostra un fulmine quando la batteria è in carica e una spina quando la batteria è completamente carica. Se iPod shuffle è stato usato come disco esterno o se è in esecuzione la sincronizzazione con iTunes, l'indicatore luminoso di stato lampeggia in arancione per informarti che devi espellere iPod shuffle prima di scollegarlo. In questo caso, la batteria potrebbe esser in carica o completamente carica. Se non vedi l'indicatore luminoso di stato, iPod shuffle potrebbe non essere collegato a una porta USB 2.0 ad alta potenza. Prova con un'altra porta USB 2.0 del computer. Per caricare la batteria se non disponi di un computer, puoi collegare iPod shuffle a un adattatore di alimentazione USB di Apple, in vendita separatamente. Per acquistare gli accessori di iPod shuffle, vai all'indirizzo www.apple.com/it/ipodstore. Per caricare la batteria utilizzando l'adattatore di alimentazione USB di Apple: 1 Collega un'estremità del cavo USB fornito con iPod shuffle all'alimentatore di corrente e inserisci l'altra estremità in iPod shuffle.Capitolo  2    Nozioni di base di iPod shuffle 8 2 Collega l'alimentatore di corrente ad una presa elettrica funzionante. Adattatore di alimentazione USB di Apple (l’adattatore potrebbe sembrare diverso) Cavo USB iPod shuffle ATTENZIONE: Accertati che l'alimentatore di corrente sia completamente assemblato prima di inserirlo in una presa di corrente. Prima dell'uso, leggi tutte le informazioni di sicurezza sull'utilizzo dell'adattatore di alimentazione USB di Apple in Capitolo 7, Sicurezza e pulizia, a pagina 28. Le batterie ricaricabili hanno un numero limitato di cicli di carica. L'autonomia della batteria e il numero di cicli di carica variano in base all'uso e alle impostazioni. Per informazioni, consulta il sito web www.apple.com/it/batteries. Controllare lo stato della batteria Puoi controllare lo stato della batteria di iPod shuffle quando è collegato o scollegato dal computer. L'indicatore luminoso di stato fornisce informazioni sulla carica restante nella batteria. Se iPod shuffle è acceso e non collegato a un computer, puoi utilizzare VoiceOver per sentire lo stato della batteria premendo il tasto di VoiceOver due volte. Indicatore luminoso di stato quando non collegato Messaggio VoiceOver Verde fisso Carica sufficiente “Batteria carica” o “Batteria al 75%” o “Batteria al 50%” Arancione fisso Carica bassa “Batteria al 25%” Rosso fisso Carica molto bassa “Batteria in esaurimento” Indicatore luminoso di stato quando collegato al computer Verde fisso Interamente carica Arancione fisso In carica Arancione lampeggiante Non scollegare (iTunes è in fase di sincronizzazione o iPod shuffle è abilitato per l'uso come disco); può essere in carica o completamente carico3 9 Utilizza iTunes sul computer per configurare iPod shuffle per riprodurre e altro contenuto audio. Quindi, collega iPod shuffle al computer e sincronizzalo con la libreria di iTunes. Continua la lettura per ottenere ulteriori informazioni sull'utilizzo di iPod shuffle, tra cui: • Ottenere musica dalla propria collezione di CD, dal disco rigido o da iTunes Store (parte di iTunes e disponibile solamente in alcuni paesi) all'applicazione iTunes sul computer. • Organizzare i tuoi brani e altri file audio in playlist. • Sincronizzare brani, audiolibri, podcast e raccolte iTunes U nella libreria iTunes con iPod shuffle • Riprodurre musica o ascoltare altri file audio quando si è in giro. Informazioni su iTunes iTunes è l'applicazione gratuita da utilizzare per configurare, organizzare e gestire i contenuti su iPod shuffle. iTunes sincronizza musica, audiolibri e podcast audio con iPod shuffle. Se non hai ancora installato iTunes 10.7 o successivo (richiesto per iPod shuffle) sul computer, puoi scaricarlo da www.itunes.com/it/download. Dopo averlo installato, iTunes si apre automaticamente quando colleghi iPod shuffle al computer. Puoi utilizzare iTunes per importare la musica dai CD e da Internet, acquistare brani e altro contenuto audio da iTunes Store, creare delle raccolte personali dei tuoi brani preferiti (chiamate playlist), sincronizzare iPod shuffle e regolarne le impostazioni. iTunes dispone inoltre di una funzione denominata Genius, che crea playlist e mix all'istante dai brani della tua libreria di iTunes che stanno bene insieme. Puoi sincronizzare i mix e le playlist Genius da iTunes su iPod shuffle. Per utilizzare Genius, ti occorre un account iTunes. Per sapere come configurare Genius, consulta Utilizzare Genius in iTunes a pagina 11. iTunes possiede inoltre molte altre funzioni. Puoi masterizzare i tuoi CD da riprodurre in lettori CD standard (se il computer dispone di un'unità di masterizzazione di CD); ascoltare radio Internet in streaming; assistere a video e spettacoli televisivi; valutare i brani in base alle proprie preferenze; e altro ancora. Per informazioni sull'utilizzo di queste funzionalità, apri iTunes e scegli Aiuto > Aiuto iTunes. Se disponi già di iTunes 10.7 o successivo sul computer e hai configurato la tua libreria di iTunes, puoi passare alla sequenza seguente, Collegare iPod shuffle a un computer per la prima volta a pagina 11. Configurazione di iPod shuffleCapitolo  3    Configurazione di iPod shuffle 10 Configurare la libreria di iTunes Per poter ascoltare musica su iPod shuffle, devi prima importarla nella libreria iTunes del computer. Le modalità per importare musica e altri componenti audio nella libreria iTunes sono tre: • Acquistare musica e audiolibri o scaricare podcast in linea da iTunes Store. • Importare musica e altri elementi audio da CD audio. • Aggiungere la musica e altro audio già presente sul computer alla libreria di iTunes. Acquistare brani e scaricare podcast utilizzando iTunes Store Se disponi di una connessione a Internet, puoi facilmente acquistare e scaricare brani, album e audiolibri utilizzando iTunes Store (disponibile in paesi selezionati). Puoi iscriverti a podcast audio e scaricarli; inoltre, puoi scaricare gratuitamente contenuti educativi da iTunes U. I podcast video non possono essere sincronizzati su iPod shuffle. Per acquistare musica in linea utilizzando iTunes Store, devi creare un account iTunes gratuito in iTunes, cercare i brani desiderati e poi acquistarli. Se disponi già di un account iTunes, puoi utilizzarlo per accedere a iTunes Store e acquistare brani. Non devi disporre di un account iTunes Store per riprodurre o scaricare podcast o lezioni di iTunes U. Per accedere a iTunes Store, apri iTunes e fai clic su iTunes Store (sotto Store) sul lato sinistro della finestra di iTunes. Aggiungere brani già presenti sul computer alla libreria di iTunes Se sul computer sono presenti dei brani codificati con formati supportati da iTunes, puoi facilmente aggiungere i brani a iTunes. Per scoprire come passare i brani dal computer a iTunes, apri iTunes e scegli Aiuto > Aiuto iTunes. Utilizzando iTunes per Windows, puoi convertire i file WMA non protetti in formato AAC o MP3. Questo può essere utile se disponi di una libreria di musica codificata in formato WMA. Per ulteriori informazioni, apri iTunes e scegli Aiuto > Aiuto iTunes. Importare musica da CD audio in iTunes iTunes è in grado di importare musica e altri elementi audio da CD audio. Se disponi di una connessione Internet, iTunes acquisisce i nomi dei brani del CD da Internet (se disponibili) e li visualizza nella finestra. Quando aggiungi dei brani a iPod shuffle, vengono incluse le informazioni sul brano. Per scoprire come importare i brani dai CD audio in iTunes, apri iTunes e scegli Aiuto > Aiuto iTunes.Capitolo  3    Configurazione di iPod shuffle 11 Inserire i nomi dei brani e altre informazioni Se non disponi di una connessione a Internet, se le informazioni del brano non sono disponibili per la musica che importi o se desideri includerne altre (come il nome del compositore), puoi inserirle manualmente. Per scoprire come inserire le informazioni relative a un brano, apri iTunes e scegli Aiuto > Aiuto iTunes. Organizzare la musica In iTunes, puoi organizzare i brani ed altri elementi in elenchi, chiamati playlist, nel modo che preferisci. Ad esempio, puoi creare una playlist con brani da ascoltare mentre svolgi attività fisica o sei in particolari stati d'animo. Puoi anche creare playlist speciali che si aggiornano automaticamente in base alle regole che hai scelto. Quando aggiungi dei brani a iTunes che soddisfano le regole, essi vengono automaticamente aggiunti alla playlist speciale. Puoi attivare Genius in iTunes e creare delle playlist di brani che stanno bene insieme sulla base del brano da te selezionato. Inoltre, Genius è in grado di organizzare automaticamente la tua libreria di iTunes ordinando e raggruppando i brani in raccolte chiamate “mix Genius”. Puoi creare tutte le playlist desiderate utilizzando qualsiasi brano della libreria di iTunes. Non puoi creare una playlist su iPod shuffle quando è scollegato da iTunes. Se aggiungi un brano a una playlist e poi lo rimuovi dalla playlist, non viene eliminato dalla libreria di iTunes. Quando ascolti le playlist su iPod shuffle, tutte le playlist create in iTunes hanno lo stesso comportamento. Puoi sceglierle per nome su iPod shuffle. Per scoprire come configurare le playlist in iTunes, apri iTunes e scegli Aiuto > Aiuto iTunes. Utilizzare Genius in iTunes Genius trova i brani della tua libreria di iTunes che stanno bene insieme e li utilizza per creare playlist e mix Genius. Genius è un servizio gratuito, ma per utilizzarlo ti occorre un account iTunes Store. Se non disponi di un account, puoi configurarne uno quando attivi Genius. Una playlist Genius si basa sul brano da te selezionato. iTunes crea quindi una playlist Genius a partire da brani che stanno bene con quello che hai selezionato. I mix Genius sono delle raccolte preselezionate di brani che stanno bene insieme. Vengono create per te da iTunes, utilizzando i brani della libreria di iTunes. Ogni mix Genius viene progettato per offrire diverse possibilità di ascolto ad ogni riproduzione: iTunes crea fino a 12 mix Genius, a seconda della varietà di musica presente nella tua libreria di iTunes. Per creare delle playlist e dei mix Genius, devi prima attivare Genius in iTunes. Per informazioni, apri iTunes e scegli Aiuto > Aiuto iTunes. Le playlist e i mix Genius creati in iTunes possono esser sincronizzate su iPod shuffle come qualsiasi altra playlist di iTunes. Non puoi aggiungere i mix Genius su iPod shuffle manualmente. Collegare iPod shuffle a un computer per la prima volta La prima volta che colleghi iPod shuffle al computer dopo aver installato iTunes, l'applicazione di apre e viene visualizzato l'assistente di configurazione. Se iTunes non si apre automaticamente, eseguilo.Capitolo  3    Configurazione di iPod shuffle 12 Per utilizzare l'assistente di configurazione di iPod shuffle: 1 Inserisci un nome per iPod shuffle. Sarà il nome con coi il dispositivo verrà visualizzato nell'elenco dei dispositivi nella parte sinistra della finestra di iTunes. 2 Seleziona le impostazioni. La sincronizzazione automatica è selezionata di default. Se la mantieni selezionata e Genius è attivato, iTunes sincronizza i mix Genius dalla tua libreria di iTunes su iPod shuffle. Se Genius non è attivato, iTunes riempie iPod shuffle con brani della tua libreria di iTunes e li raccoglie nella playlist “Tutti i brani”. Per ulteriori informazioni sulla sincronizzazione manuale e automatica, consulta il paragrafo seguente. Anche VoiceOver è abilitato di default. Mantienilo abilitato per sentire i titoli delle tracce e i nomi degli artisti, cambiare playlist e conoscere lo stato della batteria mentre ascolti iPod shuffle. Per ulteriori informazioni, consulta Utilizzare VoiceOver a pagina 18. 3 Fai clic su Fine. Puoi modificare il nome del dispositivo e le impostazioni ogni volta che colleghi iPod shuffle al computer. Dopo che hai fatto clic su Fine, viene visualizzato il pannello Riepilogo. Se hai selezionato la sincronizzazione automatica, iPod shuffle avvia la sincronizzazione. Aggiungere musica a iPod shuffle Dopo aver importato e organizzato la musica in iTunes, puoi aggiungerla facilmente a iPod shuffle. Per gestire il modo in cui i brani e altro contenuto audio vengono aggiunti a iPod shuffle dal computer, collega iPod shuffle al computer, quindi utilizza le preferenze di iTunes per scegliere le opzioni di iPod shuffle. Aggiungere contenuto manualmente o automaticamente Puoi configurare iTunes per aggiungere musica a iPod shuffle in due modi: • Sincronizzazione automatica:  quando colleghi iPod shuffle al computer, iPod shuffle viene aggiornato automaticamente perché i brani e gli altri elementi in esso contenuti coincidano con quelli della tua libreria di iTunes. Se Genius è attivato ed è la prima volta che sincronizzi iPod shuffle, iTunes utilizza fino a quattro mix Genius creati dalla tua libreria di iTunes per riempire iPod shuffle. Se rimane dello spazio libero, iTunes sincronizza dei brani aggiuntivi dalla libreria di iTunes. Se Genius non è attivato, iTunes sincronizza i brani e le playlist della tua libreria di iTunes per riempire iPod shuffle. In seguito, puoi modificare le opzioni di sincronizzazione automatica per includere playlist, artisti, album e generi selezionati. Puoi sincronizzare manualmente anche altri contenuti audio, compresi podcast, audiolibri e raccolte di iTunes U. Per ulteriori informazioni, consulta il paragrafo successivo.Capitolo  3    Configurazione di iPod shuffle 13 • Gestione manuale della musica:  quando colleghi iPod shuffle, puoi trascinare singoli brani e playlist sul dispositivo ed eliminare singoli brani e playlist da iPod shuffle. Questa opzione ti consente di aggiungere brani da più computer, senza eliminarne nessuno da iPod shuffle. Quando gestiscila musica manualmente, devi sempre espellere iPod shuffle da iTunes prima di scollegarlo. Consulta Gestire iPod shuffle manualmente a pagina 15. Sincronizzare automaticamente la musica Di default, iPod shuffle è impostato per la sincronizzazione automatica di tutti i brani e le playlist quando lo colleghi al computer. È il modo più semplice di aggiungere contenuti audio a iPod shuffle: colleghi semplicemente iPod shuffle al computer, lasci che su di esso vengano aggiunti automaticamente brani, audiolibri, podcast audio e raccolte iTunes U, lo scolleghi ed è pronto per l'uso. Se dall'ultima volta che hai collegato iPod shuffle sono stati aggiunti brani a iTunes, i brani vengono sincronizzati con iPod shuffle a seconda dello spazio disponibile. Se hai eliminato brani da iTunes, i brani vengono rimossi anche da iPod shuffle. Per sincronizzare musica con iPod shuffle: m È sufficiente collegare iPod shuffle al computer. Se iPod shuffle è impostato per la sincronizzazione automatica, l'aggiornamento si avvia immediatamente. Importante: Se colleghi iPod shuffle a un computer con cui non è sincronizzato, visualizzi un messaggio in cui ti viene chiesto se desideri sincronizzare i brani automaticamente. Se accetti, tutti i brani e i contenuti audio vengono cancellati da iPod shuffle e sostituiti con quelli presenti sul computer a cui è collegato il dispositivo. Se non accetti, puoi comunque aggiungere manualmente i brani a iPod shuffle senza cancellare quelli già presenti su iPod shuffle. Durante la sincronizzazione della musica dal computer a iPod shuffle, la finestra di stato di iTunes mostra il progredire dell'operazione e viene visualizzata un'icona di sincronizzazione accanto a iPod shuffle nell'elenco dei dispositivi. Al termine dell'aggiornamento, in iTunes visualizzerai un messaggio che ti informa che la sincronizzazione di iPod è terminata. Nella parte inferiore della finestra di iTunes viene visualizzata una barra che ti mostra la quantità di spazio utilizzata per i diversi tipi di contenuto. Se durante la configurazione di iPod shuffle non hai scelto di sincronizzare automaticamente la musica, puoi farlo in seguito. Se iPod shuffle non dispone di spazio libero sufficiente per tutta la tua musica, puoi impostare iTunes perché sincronizzi solo playlist, artisti, album e generi selezionati. Per impostare iTunes per la sincronizzazione di playlist, artisti, album e generi selezionati su iPod shuffle: 1 Collega iPod shuffle al computer. 2 In iTunes, seleziona iPod shuffle nell'elenco dei dispositivi e fai clic sul pannello Riepilogo. 3 Seleziona “Sincronizza musica”, quindi scegli “Playlist, artisti, album e generi selezionati”. 4 Seleziona le playlist, gli artisti, gli album e i generi che desideri. 5 Per impostare iTunes perché riempia automaticamente lo spazio rimanente su iPod shuffle, seleziona “Riempi automaticamente con brani lo spazio libero”. Se hai dei mix Genius, iTunes li utilizza per primi per riempire lo spazio. Se non c'è spazio per un altro mix Genius, iTunes riempie lo spazio rimanente su iPod shuffle con altri brani. 6 Fai clic su Applica. L'aggiornamento inizia automaticamente. Se selezioni l'opzione “Sincronizza solo i brani contrassegnati” nel pannello Musica, iTunes sincronizza soltanto gli elementi selezionati.Capitolo  3    Configurazione di iPod shuffle 14 Sincronizzare mix Genius su iPod shuffle Puoi impostare iTunes perché sincronizzi i mix Genius su iPod shuffle. I mix Genius possono essere sincronizzati solo automaticamente, quindi non puoi aggiungerli a iPod shuffle se gestisci i contenuti manualmente. Se i mix Genius non riempiono lo spazio disponibile e selezioni l'opzione “Riempi automaticamente con brani lo spazio libero”, iTunes seleziona e sincronizza brani aggiuntivi dalla tua libreria di iTunes. Per impostare iTunes perché sincronizzi i mix Genius su iPod shuffle: 1 In iTunes, seleziona iPod shuffle nell'elenco dei dispositivi e fai clic sul pannello Riepilogo. 2 Seleziona “Sincronizza musica”, quindi scegli “Playlist, artisti, album e generi selezionati”. 3 Sotto Playlist, seleziona i mix Genius desiderati, 4 Fai clic su Applica. Se hai selezionato l'opzione “Sincronizza solo i brani contrassegnati” nel pannello Riepilogo, iTunes sincronizza soltanto gli elementi selezionati. Sincronizzare i podcast automaticamente Le impostazioni per aggiungere podcast a iPod shuffle non sono correlate alle impostazioni per aggiungere brani. Le impostazioni dei podcast non influiscono sulle impostazioni dei brani e viceversa. Puoi impostare iTunes per sincronizzare automaticamente tutti i podcast o i podcast selezionati oppure puoi aggiungere manualmente podcast a iPod shuffle. Per impostare iTunes in modo da aggiornare automaticamente i podcast su iPod shuffle: 1 In iTunes, seleziona iPod shuffle nell'elenco dei dispositivi e fai clic sul pannello Podcast. 2 Nel pannello Podcast, seleziona “Sincronizza podcast”. 3 Seleziona le puntate dei podcast e le playlist desiderati, quindi imposta le opzioni di sincronizzazione. 4 Fai clic su Applica. Quando imposti iTunes per la sincronizzazione automatica dei podcast, iPod shuffle viene aggiornato ogni volta che lo colleghi al computer. Se hai selezionato l'opzione “Sincronizza solo i brani contrassegnati” nel pannello Riepilogo, iTunes sincronizza soltanto gli elementi selezionati. Aggiungere raccolte iTunes U a iPod shuffle iTunes U è una parte di iTunes Store dove sono a disposizione conferenze, lezioni di lingua, audiolibri e altro ancora, che puoi scaricare gratuitamente e sincronizzare su iPod shuffle. Le impostazioni per aggiungere raccolte iTunes U a iPod shuffle non sono correlate alle impostazioni per aggiungere altri contenuti e viceversa. Puoi impostare iTunes per sincronizzare automaticamente tutte le raccolte iTunes U oppure puoi aggiungerle manualmente a iPod shuffle. Per impostare iTunes perché sincronizzi automaticamente i contenuti di iTunes U: 1 In iTunes, seleziona iPod shuffle nell'elenco dei dispositivi e fai clic sul pannello iTunes U. 2 Nel pannello iTunes U, seleziona “Sincronizza iTunes U”. 3 Seleziona le raccolte e gli elementi desiderati, quindi imposta le opzioni di sincronizzazione. 4 Fai clic su Applica.Capitolo  3    Configurazione di iPod shuffle 15 Quando imposti iTunes per la sincronizzazione automatica dei podcast, iPod shuffle viene aggiornato ogni volta che lo colleghi al computer. Se hai selezionato l'opzione “Sincronizza solo i brani contrassegnati” nel pannello Riepilogo, iTunes sincronizza soltanto gli elementi selezionati. Aggiungere audiolibri a iPod shuffle Puoi acquistare e scaricare audiolibri da iTunes Store o da audible.com, oppure importarli da CD e ascoltarli su iPod shuffle. Utilizzare iTunes per aggiungere audiolibri a iPod shuffle Se sincronizzi iPod shuffle automaticamente, ogni audiolibro presente nella tua libreria di iTunes viene sincronizzato come una playlist a parte, che puoi selezionare utilizzando VoiceOver. Se gestisci manualmente il contenuto di iPod shuffle, puoi aggiungere un audiolibro alla volta. Per sincronizzare audiolibri con iPod shuffle: 1 In iTunes, seleziona iPod shuffle nell'elenco dei dispositivi e fai clic sul pannello Libri. 2 Seleziona “Sincronizza audiolibri”, quindi procedi in uno dei seguenti modi: • Seleziona “Tutti gli audiolibri”. • Seleziona “Audiolibri selezionati”, quindi specifica quelli desiderati. 3 Fai clic su Applica. L'aggiornamento inizia automaticamente. Gestire iPod shuffle manualmente Puoi gestire iPod shuffle manualmente, puoi aggiungere o rimuovere singoli brani, playlist, podcast e audiolibri. Puoi aggiungere musica e altro contenuto audio da più computer a iPod shuffle senza cancellare i contenuti già presenti su iPod shuffle. Se lo gestisci manualmente, su iPod shuffle puoi aggiungere le playlist Genius, ma non i mix Genius. Impostando iPod shuffle per la gestione manuale della musica, vengono disattivate le opzioni di sincronizzazione automatica dei pannelli Musica, Podcast e iTunes U in iTunes. Non puoi gestire manualmente alcuni contenute e sincronizzarne altri automaticamente allo stesso tempo. Se imposti iTunes per la gestione manuale del contenuto, puoi reimpostarlo successivamente per la sincronizzazione automatica. Per gestire manualmente i contenuti audio di iPod shuffle: 1 In iTunes, seleziona iPod shuffle nell'elenco dei dispositivi e fai clic sul pannello Riepilogo. 2 Nella sezione Opzioni, seleziona “Gestisci manualmente la musica”. 3 Fai clic su Applica. Quando gestisci iPod shuffle manualmente, devi sempre espellere iPod shuffle da iTunes prima di scollegarlo. Per aggiungere un brano o un altro elemento a iPod shuffle: 1 In iTunes, fai clic su Musica o su un altro elemento nell'elenco Libreria. 2 Trascina un brano o un altro elemento su iPod shuffle nell'elenco dei dispositivi. Puoi trascinare anche intere playlist per sincronizzarle con iPod shuffle, oppure selezionare più elementi e trascinarli tutti insieme su iPod shuffle.Capitolo  3    Configurazione di iPod shuffle 16 Per rimuovere un brano o un altro elemento da iPod shuffle: 1 In iTunes, seleziona iPod shuffle nell'elenco dei dispositivi. 2 Seleziona Musica, Audiolibri o Podcast sotto iPod shuffle. 3 Seleziona un brano o un altro elemento e premi il tasto Elimina o Cancella della tastiera. Se rimuovi manualmente un brano o un altro elemento da iPod shuffle, non viene eliminato dalla libreria di iTunes. Per utilizzare iTunes per la creazione di una nuova playlist su iPod shuffle: 1 In iTunes, seleziona iPod shuffle nell'elenco dei dispositivi, quindi fai clic sul pulsante Aggiungi (∂) oppure scegli File > Nuova playlist. 2 Inserisci un nome per la playlist. 3 Fai clic su Musica o su un altro elemento nell'elenco Libreria, quindi trascina i brani o altri elementi nella playlist. Se apporti modifiche a una delle playlist di iTunes, ricorda di trascinare la playlist modificata su iPod shuffle quando è collegato a iTunes. Per aggiungere brani o rimuoverli da una playlist su iPod shuffle: m Trascina un brano su una playlist in iPod shuffle per aggiungere il brano. Seleziona un brano di una playlist e premi il tasto Cancella sulla tastiera per eliminarlo. Per impostare iTunes perché sincronizzi automaticamente la musica e altri contenuti audio: 1 In iTunes, seleziona iPod shuffle nell'elenco dei dispositivi e fai clic sul pannello Riepilogo. 2 Deseleziona “Gestisci manualmente la musica”. 3 Fai clic su Applica. L'aggiornamento inizia automaticamente. Trasferire più brani su iPod shuffle Se la libreria di iTunes contiene brani in un formato con una frequenza di bit superiore, come iTunes Plus, Apple Lossless o WAV, puoi fare in modo che iTunes li converta automaticamente in file AAC da 128 kbps durante la sincronizzazione con iPod shuffle. Questa operazione non influisce sulla qualità o sulle dimensioni dei brani archiviati in iTunes. Per convertire i brani con frequenze di bit superiori in formato AAC: 1 Collega iPod shuffle al computer. 2 In iTunes, seleziona iPod shuffle nell'elenco dei dispositivi. 3 Fai clic sulla linguetta Riepilogo. 4 Seleziona Converti i brani con bit rate più alto ad ACC a 128 kbps. 5 Fai clic su Applica. Nota: I brani nei formati non supportati da iPod shuffle devonoessere convertiti se vuoi sincronizzarli con iPod shuffle. Per ulteriori informazioni sui formati supportati da iPod shuffle, consulta Se non puoi sincronizzare un brano o un altro elemento su iPod shuffle a pagina 25.4 17 Leggi questo capitolo per informazioni su come ascoltare iPod shuffle in giro. Quando scolleghi iPod shuffle dal computer, puoi portarlo addosso utilizzando l'apposito clip e ascoltare musica, audiolibri, podcast e contenuti di iTunes U. VoiceOver pronuncia il nome della traccia (brano o capitolo di un audiolibro o podcast) in riproduzione, lo stato della batteria o ti consente di scegliere un'altra playlist. Riprodurre musica Dopo aver effettuato la sincronizzazione di iPod shuffle con la musica e i file audio, puoi ascoltarli. ATTENZIONE: Prima di utilizzare iPod shuffle, leggi tutte le istruzioni sulla sicurezza, con speciale attenzione al paragrafo sui danni all'udito, in Capitolo 7, Sicurezza e pulizia, a pagina 28. Per ascoltare i brani e gli altri elementi su iPod shuffle: 1 Inserisci gli auricolari in iPod shuffle e posizionali nelle orecchie come indicato. 2 Fai scorrere l'interruttore a tre posizioni di iPod shuffle dalla posizione OFF a quella della riproduzione in ordine (⁄) o riproduzione in ordine casuale (¡). La riproduzione inizia. Per aumentare la durata della batteria quando non usi iPod shuffle, fai scorrere l'interruttore a tre posizioni su OFF. Per Esegui questa operazione Riprodurre o mettere in pausa Premi Play/Pausa (’). Ridurre o aumentare il volume Premi Volume su (∂) o Volume giù (D). Sentirai un tono se cambi il volume mentre iPod shuffle è in pausa. Passare alla traccia successiva Premi Successivo/Avanza velocemente (‘). Passare alla traccia precedente Premi Precedente/Riavvolgi (]) entro sei secondi dall'inizio della traccia. Dopo 6 secondi, premendo Precedente/Riavvolgi (]) la traccia attuale ricomincia. Avanti velocemente Tieni premuto Successivo/Avanza velocemente (‘). Riavvolgere Tieni premuto Precedente/Riavvolgi (]). Sentire il nome dell'artista e il titolo della traccia Premi il tasto di VoiceOver ( ). Ascoltare musicaCapitolo  4    Ascoltare musica 18 Per Esegui questa operazione Sentire il menu delle playlist Tieni premuto il tasto di VoiceOver ( ). Quanto senti il nome della playlist desiderata, premi il tasto VoiceOver ( ) o Play/Pausa (’) per selezionarla. Puoi premere Successivo/Avanza velocemente (‘) o Precedente/Riavvolgi (]) per spostarti velocemente attraverso le playlist. Uscire dal menu delle playlist Tieni premuto il tasto di VoiceOver ( ). L'indicatore luminoso di stato lampeggia una volta in verde in risposta a quasi tutte le azioni (riprodurre, riavvolgere, mandare avanti velocemente, utilizzare VoiceOver, regolare il volume, ecc.). Se metti in pausa iPod shuffle, l'indicatore luminoso di stato si accende in verde e rimane fisso per 30 secondi. Se raggiungi il limite massimo o minimo del volume, l'indicatore luminoso si accende tre volte in arancione. I comportamenti dell'indicatore luminoso rispetto allo stato della batteria sono descritti in Controllare lo stato della batteria a pagina 8. Impostare iPod shuffle per la riproduzione di brani in ordine o in ordine casuale Puoi impostare iPod shuffle per riprodurre i brani in ordine casuale o riprodurli nell'ordine in cui sono organizzati in iTunes. Quando attivi la riproduzione casuale, i libri, i podcast e i Mix Genius non vengono inclusi: verranno riprodotti secondo l'ordine in cui appaiono in iTunes. Per impostare iPod shuffle per la riproduzione di brani in ordine: m Fai scorrere l'interruttore a tre posizioni per riprodurre in ordine (⁄). Dopo la riproduzione dell'ultimo brano, iPod shuffle inizierà di nuovo la riproduzione del primo brano. Per impostare iPod shuffle per la riproduzione casuale: m Fai scorrere l'interruttore sulla riproduzione casuale (¡). Per riprodurre nuovamente i brani in ordine casuale, scorri l'interruttore a tre posizioni dalla riproduzione casuale (¡) alla riproduzione (⁄), quindi torna di nuovo alla riproduzione casuale. Utilizzare VoiceOver iPod shuffle può fornire un maggiore controllo sulle opzioni di riproduzione pronunciando i titoli dei brani e i nomi degli artisti e pronunciando le playlist tra cui scegliere. VoiceOver fornisce anche informazioni sullo stato della batteria e altri messaggi. Per utilizzarlo, abilita VoiceOver da iTunes. Puoi abilitare VoiceOver al momento della prima configurazione di iPod shuffle oppure in un secondo momento. VoiceOver è disponibile in alcune lingue. Per impostare le opzioni di VoiceOver, utilizza il pannello Riepilogo in iTunes. Le sezioni seguenti descrivono come attivare e personalizzare VoiceOver. Per abilitare VoiceOver quando configuri iPod shuffle: 1 Collega iPod shuffle al computer. 2 Segui le istruzioni su schermo in iTunes. Di default, VoiceOver è abilitato. 3 Fai clic su Continua. 4 Nella linguetta Riepilogo, sotto Voice Feedback, scegli la lingua desiderata nel menu a comparsa Lingua.Capitolo  4    Ascoltare musica 19 Imposta la lingua per la pronuncia da utilizzare per i messaggi di sistema, i nomi delle playlist, i titoli dei brani e i nomi degli artisti. Nota: Per selezionare un'altra lingua per tracce specifiche, selezionale in iTunes, scegli File > Ottieni informazioni, scegli una lingua di VoiceOver dal menu a comparsa del pannello Opzioni, quindi fai clic su OK. 5 Fai clic su Applica. Al termine della configurazione, VoiceOver è abilitato su iPod shuffle. Per abilitare VoiceOver in qualsiasi momento: 1 Collega iPod shuffle al computer. 2 In iTunes, seleziona iPod shuffle nell'elenco dei dispositivi e fai clic sul pannello Riepilogo. 3 In “Feedback voce”, seleziona “Abilita VoiceOver”. 4 Fai clic su Applica. 5 Scegli la lingua desiderata nel menu a comparsa in Voice Feedback. 6 Fai clic su Applica. Al termine della sincronizzazione, VoiceOver è abilitato. Per disabilitare VoiceOver: 1 In iTunes, seleziona iPod shuffle nell'elenco dei dispositivi e fai clic sul pannello Riepilogo. 2 In “Feedback voce”, deseleziona “Abilita VoiceOver”. 3 Fai clic su Applica. Al termine della sincronizzazione, VoiceOver è disabilitato. Sentirai ancora alcuni annunci di sistema in inglese su iPod shuffle, come lo stato della batteria, i messaggi di errore e un menu generico di playlist numerate. Non sentirai i titoli dei brani e i nomi degli artisti. Sentire le informazioni di una traccia VoiceOver pronuncia il titolo e il nome dell'artista del brano attuale mentre lo ascolti su iPod shuffle. Per sentire le informazioni della traccia attuale: m Premi il tasto di VoiceOver ( ) durante la riproduzione. Sentirai il nome dell'artista e il titolo della traccia attuale. Puoi utilizzare VoiceOver per passare ad un altro titolo. Per navigare utilizzando le informazioni di una traccia: • se iPod shuffle è in riproduzione, premi il tasto VoiceOver ( ) per sentire le informazioni della traccia attuale; premi Successivo/Avanza velocemente (‘) per passare alla traccia successiva e sentire le relative informazioni; premi Precedente/Riavvolgi (]) per spostarti alla traccia precedente e sentire le relative informazioni. • se iPod shuffle è in pausa, premi il tasto VoiceOver ( ) per sentire le informazioni della traccia attuale; premi Successivo/Avanza velocemente (‘) per sentire le informazioni della traccia successiva; premi Precedente/Riavvolgi (]) per sentire le informazioni della traccia precedente. Premi il tasto VoiceOver o Play/Pausa (’) per riprodurre la traccia.Capitolo  4    Ascoltare musica 20 Modificare le playlist Quando VoiceOver è abilitato, puoi sentire i nomi delle playlist e sceglierne una qualsiasi di quelle che hai sincronizzato su iPod shuffle. Se sono sincronizzati audiolibri o podcast audio su iPod shuffle, i loro titoli vengono letti come parte del menu delle playlist. Se VoiceOver è disabilitato in iTunes, le playlist vengono identificate in ordine numerico (per esempio “Playlist 1, Playlist 2”, ecc.), invece che per nome. Il menu delle playlist annuncia ogni elemento in questo ordine: • La playlist attuale (se disponibile). • “Tutti i brani” (playlist di default di tutti i brani su iPod shuffle). • Tutte le playlist, comprese le playlist Genius, in ordine alfabetico • Tutti i mix Genius, in ordine alfabetico • Tutti i podcast, in ordine alfabetico • Tutte le raccolte iTunes U, in ordine alfabetico • Tutti gli audiolibri, in ordine alfabetico Per scegliere un elemento dal menu delle playlist: 1 Tieni premuto il tasto di VoiceOver ( ). Sentirai i nomi delle playlist. 2 Quanto senti il nome della playlist desiderata, premi il tasto VoiceOver ( ) o Play/Pausa (’) per selezionarla. Viene riprodotto il primo elemento che appare nella playlist. Quando stai ascoltando il menu delle playlist, puoi premere Successivo/Avanza velocemente (‘) o Precedente/Riavvolgi (]) per spostarti avanti e indietro nel menu delle playlist Per riavviare una playlist, segui i passi descritti sopra per selezionare la playlist desiderata. Per uscire dal menu delle playlist: m Tieni premuto il tasto di VoiceOver ( ). Impostare le tracce per la riproduzione allo stesso livello di volume Il volume dei brani e di altri elementi audio può variare in base alle modalità di registrazione o alla codifica. Puoi impostare iTunes in modo da regolare automaticamente il volume dei brani per riprodurli allo stesso livello di volume relativo e puoi impostare iPod shuffle perché utilizzi l'impostazione di volume di iTunes. La verifica del suono è attivata di default in iTunes, ma non in iPod shuffle. Per impostare iTunes per la riproduzione dei brani allo stesso volume: 1 In iTunes, scegli iTunes > Preferenze (su un computer Mac) oppure Modifica > Preferenze (su un PC Windows). 2 Fai clic su Riproduci e scegli "Livelli volume". Per configurare iPod shuffle in modo che utilizzi l'impostazione del volume di iTunes: 1 Collega iPod shuffle al computer. 2 In iTunes, seleziona iPod shuffle nell'elenco dei dispositivi. 3 Fai clic sulla linguetta Riepilogo. 4 Nella sezione Opzioni, seleziona “Abilita Verifica volumi”. 5 Fai clic su Applica. Se non hai attivato l’opzione di verifica del volume in iTunes, configurandola su iPod shuffle non sortirai alcun effetto.Capitolo  4    Ascoltare musica 21 Impostare un limite di volume Puoi impostare un limite del volume per iPod shuffle. Inoltre puoi impostare una password in iTunes per evitare la modifica di questa impostazione da parte di persone senza autorizzate. Se hai impostato un limite di volume su iPod shuffle, l'indicatore luminoso di stato lampeggia tre volte in arancione se tenti di aumentare il volume oltre il limite massimo. Per impostare il limite massimo di volume per iPod shuffle: 1 Imposta iPod shuffle al volume massimo desiderato. 2 Collega iPod shuffle al computer. 3 In iTunes, seleziona iPod shuffle nell'elenco dei dispositivi e fai clic sul pannello Riepilogo. 4 Nella sezione Opzioni, seleziona “Limita il volume massimo”. 5 Trascina il cursore sul volume massimo desiderato. L'impostazione iniziale del cursore mostra il volume a cui iPod shuffle era impostato quando lo hai collegato al computer. ATTENZIONE: Il livello di volume potrebbe anche variare a seconda del tipo di auricolari o di cuffie che usi. Per eliminare il limite massimo di volume: 1 Collega iPod shuffle al computer. 2 In iTunes, seleziona iPod shuffle nell'elenco dei dispositivi e fai clic sul pannello Riepilogo. 3 Nella sezione Opzioni, deseleziona “Limita il volume massimo”. Bloccare e sbloccare i pulsanti di iPod shuffle Puoi bloccare i pulsanti di iPod shuffle per evitare che si attivino se li premi accidentalmente. Questa funzionalità richiede il software 1.0.1 o versione successiva (collega iPod shuffle a iTunes per aggiornare il software). Per bloccare i pulsanti di iPod shuffle: m Tieni premuto Play/Pausa (’) per tre secondi. Quando i pulsanti vengono bloccati, l'indicatore luminoso di stato lampeggia in arancione per tre volte. Se premi un pulsante quando i pulsanti sono bloccati, l'indicatore luminoso di stato lampeggia in arancione una volta. Per sbloccare i pulsanti: m Tieni premuto di nuovo Play/Pausa (’) per tre secondi. Quando i pulsanti vengono sbloccati, l'indicatore luminoso di stato lampeggia in arancione per tre volte. Se indossi gli auricolari, udirai un tono quando i pulsanti vengono bloccati o sbloccati.5 22 Puoi utilizzare iPod shuffle per caricarvi anche i tuoi dati oltre alla musica. Leggi questo capitolo per informazioni sulla modalità di utilizzo di iPod shuffle come un disco rigido esterno. Utilizzare iPod shuffle come disco esterno Puoi utilizzare iPod shuffle come disco esterno per archiviare file di dati. Per sincronizzare iPod shuffle con musica e altro audio da ascoltare, devi utilizzare iTunes. Non puoi riprodurre file audio che copi su iPod shuffle utilizzando il Finder di Macintosh o Esplora risorse di Windows. Per abilitare l'utilizzo di iPod shuffle come disco esterno: 1 Collega iPod shuffle al computer. 2 In iTunes, seleziona iPod shuffle nell'elenco dei dispositivi e fai clic sul pannello Riepilogo. 3 Nella sezione Opzioni, seleziona Abilita utilizzo come disco per vedere le impostazioni del disco potresti dover scorrere verso il basso. 4 Fai clic su Applica. Quando usi iPod shuffle come disco esterno, l'icona del disco di iPod shuffle appare sulla scrivania di un computer Mac oppure come la successiva lettera di disco disponibile in "Esplora risorse" di un PC Windows. Quando iPod shuffle è abilitato come disco rigido e lo colleghi al computer, l'indicatore luminoso di stato si accende in arancione fisso. Prima di scollegare iPod shuffle dal computer, accertati di espellerlo in iTunes. Copiare file tra computer Quando abiliti l'utilizzo come disco su iPod shuffle, puoi copiare file da un computer all'altro. iPod shuffle è formattato come volume FAT-32, supportato sia dai computer Mac che PC. Questo ti consente di utilizzare iPod shuffle per copiare file tra computer con sistemi operativi diversi. Per copiare i file tra computer: 1 Dopo avere abilitato l'uso di iPod shuffle come disco, collegalo al computer da cui desideri copiare i file. Importante: Se iPod shuffle è impostato per la sincronizzazione automatica, quando lo colleghi a un computer o a un account utente diverso, viene visualizzato un messaggio in cui ti viene chiesto se desideri inizializzare iPod shuffle e sincronizzarlo con la nuova libreria di iTunes. Se non desideri inizializzare il contenuto di iPod shuffle, fai clic su Annulla. Archiviare file su iPod shuffleCapitolo  5    Archiviare file su iPod shuffle 23 2 Utilizzando il file di sistema del computer (il Finder su un Mac, Esplora risorse su un PC), trascina i file desiderati su iPod shuffle. 3 Scollega iPod shuffle quindi collegalo all'altro computer. Di nuovo, fai clic su Annulla se non desideri inizializzare il contenuto di iPod shuffle. 4 Trascina i file da iPod shuffle nella posizione desiderata sull'altro computer. Evitare che iTunes si apra automaticamente Puoi impedire l'avvio automatico di iTunes al momento della connessione di iPod shuffle al computer. Per evitare l'avvio automatico di iTunes: 1 Collega iPod shuffle al computer. 2 In iTunes, seleziona iPod shuffle nell'elenco dei dispositivi e fai clic sul pannello Riepilogo. 3 Nella sezione Opzioni, deseleziona Apri iTunes quando questo iPod è collegato. 4 Fai clic su Applica.6 24 La maggior parte dei problemi con iPod shuffle può essere risolta rapidamente seguendo i consigli contenuti in questo capitolo. Le 5 R: Reimposta, riprova, riavvia, reinstalla, ripristina Tieni in mente questi cinque suggerimenti di base se riscontri dei problemi con iPod shuffle.