欢迎来到天天文库
浏览记录
ID:40058094
大小:161.83 KB
页数:18页
时间:2019-07-18
《Data Formatting Guide for Core Foundation》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、DataFormattingGuideforCoreFoundationContentsIntroductiontoDataFormattingGuideforCoreFoundation4CreatingandUsingCFDateFormatterObjects5CreatingDateFormatters5UseFormatterStylestoPresentDatesandTimesWiththeUser’sPreferences5UseFormatStringstoSpecifyCustomFormats8FixedFormats8CustomFormatsfo
2、rUser-VisibleDates9CreatingandUsingCFNumberFormatterObjects11CreatingNumberFormatters11UsingNumberFormatStyles13CustomFormatterProperties15DocumentRevisionHistory172011-03-08
3、Copyright©2011AppleInc.AllRightsReserved.2ListingsCreatingandUsingCFDateFormatterObjects5Listing1Comparingdateform
4、atstyles7CreatingandUsingCFNumberFormatterObjects11Listing1Codesampleshowinghowtocreateanumberformatterusingaformatterstyle11Listing2Codesampleshowinghowtocreateanumberformatterusingaformatterstring12Listing3Comparingnumberformatstyles13Listing4Usingnumberformatstrings152011-03-08
5、Copyrig
6、ht©2011AppleInc.AllRightsReserved.3IntroductiontoDataFormattingGuideforCoreFoundationFormattersdefineacommoninterfaceforcreating,interpreting,andvalidatingthetextualrepresentationofobjects.TheCoreFoundationprovidestwoopaquetypes,CFDateFormatterandCFNumberFormatter,thatyouusetoformatdatesa
7、ndnumbersrespectively.TheFoundationframeworkprovidestwoanalogousclasses,NSDateFormatterandNSNumberFormatter.AlthoughtheformatterobjectsinCoreFoundationandFoundationaresimilar,theyarenottoll-freebridged.ThisdocumentassumesyouarefamiliarwiththeconceptspresentedinDataFormattingGuide.●“Creati
8、ngandUsingCFDateFormatterObjects”(page5)describeshowtocreateandusedateformatters.●“CreatingandUsingCFNumberFormatterObjects”(page11)describeshowtocreateandusenumberformatters.2011-03-08
9、Copyright©2011AppleInc.AllRightsReserved.4CreatingandUsingCFDateFormatterObjectsDateformattersformatthe
10、textualrepresentationofdateobjectsandconverttextualrepresentationsofdatesandtimesintodateobjects.Youcreatedateformatterobjectsbyspecifyingalocale(typicallytheuser'scurrentlocale)andatimestyle,youcanalsospecifyacustomformatstring.CreatingDateFormattersYoucreateadatef
此文档下载收益归作者所有