欢迎来到天天文库
浏览记录
ID:34558725
大小:2.46 MB
页数:128页
时间:2019-03-07
《App2012 - Programming With ObjectiveC.pdf》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、ProgrammingwithObjective-CContentsAboutObjective-C7AtaGlance7AnAppIsBuiltfromaNetworkofObjects7CategoriesExtendExistingClasses8ProtocolsDefineMessagingContracts8ValuesandCollectionsAreOftenRepresentedasObjective-CObjects8BlocksSimplifyCommonTasks9ErrorObjectsAreUsedforRuntime
2、Problems9Objective-CCodeFollowsEstablishedConventions9Prerequisites10SeeAlso10DefiningClasses11ClassesAreBlueprintsforObjects11MutabilityDeterminesWhetheraRepresentedValueCanBeChanged12ClassesInheritfromOtherClasses12TheRootClassProvidesBaseFunctionality14TheInterfaceforaClas
3、sDefinesExpectedInteractions15BasicSyntax15PropertiesControlAccesstoanObject’sValues15MethodDeclarationsIndicatetheMessagesanObjectCanReceive17ClassNamesMustBeUnique19TheImplementationofaClassProvidesItsInternalBehavior20BasicSyntax21ImplementingMethods21Objective-CClassesAre
4、alsoObjects22Exercises23WorkingwithObjects24ObjectsSendandReceiveMessages24UsePointerstoKeepTrackofObjects26YouCanPassObjectsforMethodParameters27MethodsCanReturnValues28ObjectsCanSendMessagestoThemselves302012-07-20
5、©2012AppleInc.AllRightsReserved.2ContentsObjectsCanCallMeth
6、odsImplementedbyTheirSuperclasses31ObjectsAreCreatedDynamically34InitializerMethodsCanTakeArguments36ClassFactoryMethodsAreanAlternativetoAllocationandInitialization36UsenewtoCreateanObjectIfNoArgumentsAreNeededforInitialization37LiteralsOfferaConciseObject-CreationSyntax37Ob
7、jective-CIsaDynamicLanguage38DeterminingEqualityofObjects39Workingwithnil40Exercises41EncapsulatingData43PropertiesEncapsulateanObject’sValues43DeclarePublicPropertiesforExposedData43UseAccessorMethodstoGetorSetPropertyValues44DotSyntaxIsaConciseAlternativetoAccessorMethodCal
8、ls45MostPropertiesAreBackedbyInstanceVariables46AccessInstanceVariablesDirectlyfromInitializerMethods48YouCanImplementCustomAccessorMethods51PropertiesAreAtomicbyDefault52ManagetheObjectGraphthroughOwnershipandResponsibility53AvoidStrongReferenceCycles58UseStrongandWeakDeclar
9、ationstoManageOwnership61UseUnsafeUnretainedReferencesforSomeClasses
此文档下载收益归作者所有