内容简介
Ahands–onapproachtoiPadapplicationdevelopmentBeginningiPadApplicationDevelopmentiswrittentohelpjumpstartbeginningiPaddevelopers.Itcoversthevarioustopicsinsuchamannerthatyouwillprogressivelylearnwithoutbeingoverwhelmedbythedetails.Itadoptsthephilosophythatthebestwaytolearnisbydoing,hencethenumerousTryItOutsectionsinallthechapters,whichfirstshowyouhowtobuildsomethingandthenexplainhowthingswork.AlthoughiPadprogrammingisahugetopic,theaimforthisbookistogetyoustartedwiththefundamentals,andhelpyouunderstandtheunderlyingarchitectureoftheSDK,andappreciatewhythingsaredonecertainways.Afterreadingthisbook(anddoingtheexercises),youwillbewellequippedtotackleyournextiPadprogrammingchallenge.ThisbookisforthebeginningiPaddeveloperwhowantstostartdevelopingiPadapplicationsusingtheAppleiPhoneSDK.Totrulybenefitfromthisbook,youshouldhavesomebackgroundinprogrammingandatleastbefamiliarwithobject–orientedprogrammingconcepts.IfyouaretotallynewtotheObjective–Clanguage,youmightwanttojumpstraighttoAppendixD,whichprovidesanoverviewofthelanguage.Alternatively,youcanuseAppendixDasaquickreferencewhileyoutacklethevariouschapters,checkingoutthesyntaxasyoutrytheexercises.Dependingonyourlearningpattern,oneofthoseapproachesmayworkbestforyou.WhatThisBookCoversThisbookcoversthefundamentalsofiPadprogrammingusingtheiPhoneSDK.Itisdividedinto18chaptersandfourappendices.Chapter1:GettingStartedwithiPadProgrammingcoversthevarioustoolsfoundintheiPhoneSDKandexplainstheirusesiniPaddevelopment.Chapter2:WriteYourFirstHelloWorld!ApplicationgetsyoustartedwithXcodeandInterfaceBuildertobuildaHelloWorldapplication.Thefocusisongettingyourhandsdirty.Moredetailsonthevariouspartsandcomponentsarecoveredinsubsequentchapters.Chapter3:Views,Outlets,andActionscoversthefundamentalconceptsofiPadprogramming:outletsandactions.YoulearnhowoutletsandactionsallowyourcodetointeractwiththevisualelementsinInterfaceBuilderandwhytheyareanintegralpartofeveryiPadapplication.YouwillalsolearnaboutthevariousUIwidgetsknownasviewsthatmakeuptheuserinterfaceofyouriPadapplication.Chapter4:ViewControllersdiscussesthevariousviewcontrollersavailableintheiPhoneSDK.YouwilllearnhowtodevelopdifferenttypesofiPadapplications–View–based,Window–based,SplitView–based,aswellasTabBarapplications.Chapter5:KeyboardInputsshowsyouhowtodealwiththevirtualkeyboardinyouriPad.Youseehowtohidethekeyboardondemandandhowtoensurethatyourviewsarenotblockedbythekeyboardwhenitisdisplayed.Chapter6:ScreenRotationsdemonstrateshowyoucanreorientyourapplication′sUIwhenthedeviceisrotated.Youlearnaboutthevariouseventsthatarefiredwhenthedeviceisrotated.Youalsolearnhowtoforceyourapplicationtodisplayinacertainorientation.Chapter7:UsingtheTableViewexploresoneofthemostpowerfulviewsintheiPhoneSDK–theTableview.TheTableviewiscommonlyusedtodisplayrowsofdata.Inthischapter,youalsolearnhowtoimplementsearchcapabilitiesinyourTableview.Chapter8:ApplicationPreferencesdiscussestheuseofapplicationsettingstopersistapplicationpreferences.Usingapplicationsettings,youcanaccesspreferencesrelatedtoyourapplicationthroughtheSettingsapplicationavailableontheiPad.Chapter9:FileHandlingshowshowyoucanpersistyourapplicationdatabysavingthedatatofilesinyourapplication′ssandboxdirectory.Youalsolearnhowtoaccessthevariousfoldersavailableinyourapplicationsandbox.Chapter10:DatabaseStorageUsingSQLLite3coverstheuseoftheembeddedSQLite3databaselibrarytostoreyourdata.Chapter11:SimpleAnimationsprovidesanoverviewofthevarioustechniquesyoucanusetoimplementsimpleanimationsontheiPad.YoualsolearnaboutthevariousaffinetransformationssupportedbytheiPhoneSDK.Chapter12:GestureRecognizersprovidesanoverviewofthevariousgesturerecognizersavailableintheiPhoneSDKtohelpyourdeviceinterpretuser′sinputgestures.Chapter13:AccessingtheAccelerometershowshowyoucanaccesstheaccelerometerthatcomeswitheveryiPad.Youwillalsolearnhowtodetectshakestoyourdevice.Chapter14:WebServicesteachesyouhowtoconsumeWebservicesfromwithinyouriPadapplication.YouwilllearnthevariouswaystocommunicatewithWebservices–SOAP,HTTPGET,andHTTPPOST.YouwillalsolearnhowtoparsethereturningXMLresultreturnedbytheWebservice.Chapter15:BluetoothProgrammingexplorestheuseoftheGameKitframeworkforBluetoothprogramming.YouwilllearnhowtogettwoiPadstocommunicateusingaBluetoothconnection.YouwillalsolearnhowtoimplementvoicechattingoveraBluetoothconnection.Chapter16:BonjourProgrammingshowshowyoucanpublishservicesonthenetworkusingtheBonjourprotocol.Chapter17:ApplePushNotificationServicesexplainshowyoucanimplementapplicationsthatusepushnotifications.TheAPNsallowsyourapplicationstoconstantlyreceivestatusupdatesfromaserviceprovidereventhoughtheapplicationmaynotberunning.Chapter18:DisplayingMapsshowshowtobuildlocation–basedservicesapplicationusingtheMapKitframework.Youwillalsolearnhowtoobtaingeographicallocationsdataandusethemtodisplayamap.AppendixA:AnswerstoExercisescontainsthesolutionstotheend–of–chapterexercisesfoundineverychapterexceptChapter1.AppendixB:GettingAroundinXcodeprovidesaquickrun–throughofthemanyfeaturesinXcode.AppendixC:GettingAroundinInterfaceBuilderprovidesanoverviewofthemanyfeaturesofInterfaceBuilder.AppendixD:CrashCourseinObjective–CprovidesacrashcourseinObjective–C.Readerswhoarenewtothislanguageshouldreadthischapterbeforegettingstarted.