BinaryData.pdf

(136 KB) Pobierz
Binary Data Programming Guide
BinaryDataProgrammingGuide
DataManagement:DataTypes&Collections
2009-08-06
695673696.001.png
AppleInc.
©2003,2009AppleInc.
Allrightsreserved.
Nopartofthispublicationmaybereproduced,
storedinaretrievalsystem,ortransmitted,in
anyformorbyanymeans,mechanical,
electronic,photocopying,recording,or
otherwise,withoutpriorwrittenpermissionof
AppleInc.,withthefollowingexceptions:Any
personisherebyauthorizedtostore
documentationonasinglecomputerfor
personaluseonlyandtoprintcopiesof
documentationforpersonaluseprovidedthat
thedocumentationcontainsApple’scopyright
notice.
TheApplelogoisatrademarkofAppleInc.
Nolicenses,expressorimplied,aregranted
withrespecttoanyofthetechnologydescribed
inthisdocument.Appleretainsallintellectual
propertyrightsassociatedwiththetechnology
describedinthisdocument.Thisdocumentis
intendedtoassistapplicationdevelopersto
developapplicationsonlyforApple-labeled
computers.
AppleInc.
1InfiniteLoop
Cupertino,CA95014
408-996-1010
Apple,theApplelogo,Carbon,Cocoa,Mac,
andMacOSaretrademarksofAppleInc.,
registeredintheUnitedStatesandother
countries.
EventhoughApplehasreviewedthisdocument,
APPLEMAKESNOWARRANTYORREPRESENTATION,
EITHEREXPRESSORIMPLIED,WITHRESPECTTO
THISDOCUMENT,ITSQUALITY,ACCURACY,
MERCHANTABILITY,ORFITNESSFORAPARTICULAR
PURPOSE.ASARESULT,THISDOCUMENTIS
PROVIDED“ASIS,”ANDYOU,THEREADER,ARE
ASSUMINGTHEENTIRERISKASTOITSQUALITY
ANDACCURACY.
INNOEVENTWILLAPPLEBELIABLEFORDIRECT,
INDIRECT,SPECIAL,INCIDENTAL,OR
CONSEQUENTIALDAMAGESRESULTINGFROMANY
DEFECTORINACCURACYINTHISDOCUMENT,even
ifadvisedofthepossibilityofsuchdamages.
THEWARRANTYANDREMEDIESSETFORTHABOVE
AREEXCLUSIVEANDINLIEUOFALLOTHERS,ORAL
ORWRITTEN,EXPRESSORIMPLIED.NoApple
dealer,agent,oremployeeisauthorizedtomake
anymodification,extension,oradditiontothis
warranty.
Somestatesdonotallowtheexclusionorlimitation
ofimpliedwarrantiesorliabilityforincidentalor
consequentialdamages,sotheabovelimitationor
exclusionmaynotapplytoyou.Thiswarrantygives
youspecificlegalrights,andyoumayalsohave
otherrightswhichvaryfromstatetostate.
695673696.002.png
Contents
IntroductiontoBinaryDataProgrammingGuideforCocoa 7
OrganizationofThisDocument 7
DataObjects 9
WorkingWithBinaryData 11
CreatingDataObjectsFromRawBytes 11
CreatingDataObjectsFromFilesorURLs 11
AccessingandComparingBytes 12
CopyingDataObjects 12
SavingDataObjects 13
WorkingWithMutableBinaryData 15
ModifyingBytes 15
AppendingBytes 16
ReplacingBytes 16
DocumentRevisionHistory 19
2009-08-06 | © 2003, 2009 Apple Inc. All Rights Reserved.
3
695673696.003.png
4
2009-08-06 | © 2003, 2009 Apple Inc. All Rights Reserved.
Listings
WorkingWithMutableBinaryData 15
Listing1 Modifyingbytes 15
Listing2 Appendingbytes 16
Listing3 Replacingbytes 16
2009-08-06 | © 2003, 2009 Apple Inc. All Rights Reserved.
5
Zgłoś jeśli naruszono regulamin