Upgrade to Pro — share decks privately, control downloads, hide ads and more …

K/NとNSKeyedArchiverと私

 K/NとNSKeyedArchiverと私

RyuNen344

March 16, 2023
Tweet

More Decks by RyuNen344

Other Decks in Programming

Transcript

  1. ຊ೔ͷରԠද J04 BOESPJE ͭ·Γʁ 6TFS%FGBVMUT 4IBSFE1SFGFSFODFT YNM /4$PEJOH !4FSJBMJ[BCMF TFSJBMJ[FՄೳϚʔΧʔ

    /4,FZFE"SDIJWFS 0CKFDU0VUQVU4USFBN TFSJBMJ[F࣮ߦΫϥε /4,FZFE6OBSDIJWFS 0CKFDU*OQVU4USFBN EFTFSJBMJ[F࣮ߦΫϥε
  2. Ұ࣌తͳ৘ใอଘઌ • DBʹอଘ͢Δ·Ͱ΋ແ͍σʔλ • android • SharedPreferencesʹॻ͖ग़͢ • ߏ଄ମ͸JsonStringͱͯ͠ॻ͖ࠐΉ(͜ͱ͕ࢲ͸ଟ͍Ͱ͢, GsonͱMoshi͞·͞·)

    • iOS • UserDefaultsʹॻ͖ग़͢ • NSData, NSString, NSNumber, NSDate, NSArray, NSDictionaryͷ੍ݶ͋Γ • ߏ଄ମ͸NSDataͱͯ͠ॻ͖ࠐΉͷָ͕
  3. ·ͱΊ • protocol͸K/N্ͩͱ**Protocolͱ͍͏interfaceʹͳͬͯͨΓ͢Δ • Type Method͸K/N্ͩͱ**Meta classʹੜ͍͑ͯͨΓ͢Δ • SwiftͱObj-CͰAPI͕ҧ͏ͷͰެࣜDoc͸Obj-CͷΛࢀর͢Δ •

    Obj-CͷAPI͕K/N্ͩͱͲͷΑ͏ͳఆٛʹͳ͍ͬͯΔ͔͸IDE্Ͱδϟϯϓͯ֬͠ ೝͰ͖ΔɺJetBrainsΛ৴͡Ζʂʂ • archive, unarchive͢Δίʔυ͸ࢀরͷϦϙδτϦʹࡌͤͯΔͷͰͦ͜ͰΈͯͩ͘ ͍͞