본문 바로가기
[android] Define relationships between objects - Room 에 대해 알아보자 - SQLite 는 relational db 이기 때문에, object 간의 관계를 정의할 수 있다. 대부분의 ORM lib 이 entity object 간에 상호 참조를 지원하지만, Room 은 명시적으로 이것을 금지한다. 금지한 기술적 이유는 아래와 같다. Understand why Room doesn’t allow object references (중략된 번역) https://developer.android.com/training/data-storage/room/referencing-data.html#understand-no-object-references - Room 은 entity class 간 object reference 를 허용하지 않는다. 대신 명시적으로 앱이 필요에 따라 data 를 요.. 2021. 5. 1.
[ios] NSManagedObject description 에서는 relationship 을 print 하지 말자!! [ios] NSManagedObject description 에서는 relationship 을 print 하지 말자!! -NSManagedObject 의 description 에서 relationship 에 해당하는 item 을 찍으면( 그런 item 은 기본으로 fault ), fault 가 fire 되지 않으면서 bad memory access error 가 발생할 수 있다. -게다가 해당 property 들을 실제로 접근해서 쓰는 것이 아닌데, description 을 호출했다는 이유로 fault 가 풀려 버린다면, 이는 메모리 낭비로도 이어질 수 있다. -그러므로, description 에서 relationship 을 print 하지 말아라!!!! bad memory access error, de.. 2017. 11. 9.
[ios/tutorial] Core Data - Creating and Saving Managed Objects [ios/tutorial] Core Data - Creating and Saving Managed Objects https://developer.apple.com/library/watchos/documentation/Cocoa/Conceptual/CoreData/CreatingObjects.html#//apple_ref/doc/uid/TP40001075-CH5-SW1 Creating Managed Objects -NSManagedObject 는 Core Data 의 model object 이다.NSManagedObject 는 2개의 element 를 갖는다. entity description ( NSEntityDescription 과 managed object context ( NSManagedObjec.. 2017. 11. 6.
[ios/tutorial] Core Data - Creating and Modifying Custom Managed Objects [ios/tutorial] Core Data - Creating and Modifying Custom Managed Objects https://developer.apple.com/library/watchos/documentation/Cocoa/Conceptual/CoreData/LifeofaManagedObject.html#//apple_ref/doc/uid/TP40001075-CH16-SW1-NSManagedObject 는 generic class 이다. Creating Custom Managed Object Subclasses -@interface MyManagedObject : NSManagedObject @property (nonatomic, strong) NSString *title;@prop.. 2017. 11. 5.
[ios/tutorial] Core Data - Creating a Managed Object Model [ios/tutorial] Core Data - Creating a Managed Object Model https://developer.apple.com/library/watchos/documentation/Cocoa/Conceptual/CoreData/KeyConcepts.html#//apple_ref/doc/uid/TP40001075-CH30-SW1 -model layer 를 관리하는 framework를 core data 라고 부른다.많은 것을 자동화시켜서 제공한다. -Core data 의 schema 는 managed object model 로 mapping 된다. ( NSManagedObjectModel )이 model 은 소위 table 이라고 부르는 entity 들의 집합이다. Creatin.. 2017. 11. 2.
[iOS Study] 코어 데이터 [iOS Study] 코어 데이터 출처 : 아론 힐리가스의 iOS 프로그래밍 -데이터를 로컬에 저장하는 방법은 “아카이빙” 또는 “코어 데이터” 를 사용한다. -아카이빙의 가장 큰 결점은 전부 다냐 아무것도 아니냐는 특성에 있다.아카이브 안의 내용에 접근하려면 전체 파일을 언아카이브해야 한다.변경사항을 저장하려면 전체 파일을 다시 쓰기 해야 한다.반면 코어 데이터(Core Data)는 저장된 객체의 일부만 가져올 수 있다.그리고 어떤 객체를 변경한다면 파일의 해당 부분만 갱신할 수 있다.이러한 점진적 가져오기, 업데이트, 삭제, 삽입은 파일시스템과 메모리 사이를 오가는 많은 모델 객체를 가지는 경우 앱의 급격한 성능 향상을 가져올 수 있다. -코어 데이터는 객체-관계형 매핑 ( object-relatio.. 2016. 3. 25.
반응형