본문 바로가기

문법

[Swift] CoreData 속성 중 있는 Transformable 타입은 어디에쓰이나?

  • Transformable 유형에 대해 알아보았따.

=> CoreData내 비표준 객체 유형을 저장하는데 유용하다. 예로 UIImages를 Core Data내의 속성으로 저장할 수 있는 코드를 제공한다.

이미지 데이터는 이미지의 PNG표현이 포함된 NSData인스턴스로 변환됩니다. 이것은 사용자 정의 NSValueTransformer에 의해 모두 투명하게 처리됩니다.

https://stackoverflow.com/questions/3014498/what-can-i-do-with-an-transformable-attribute-type-in-core-data-on-the-iphone

 

애플이 Data유형은 Transformable을 사용하라고 문서에 권장하고있따.

https://developer.apple.com/forums/thread/652867