swift realm @objc dynamic var error
Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=io.realm Code=10 "Migration is required due to the following errors:
- Property 'Airing.onGoing' has been added.
- Property 'PvrAiring.onGoing' has been added.
- Property 'PvrAiring.onGoingStatus' has been removed.
- Property 'Airing.onGoingStatus' has been removed." UserInfo={NSLocalizedDescription=Migration is required due to the following errors:
- Property 'Airing.onGoing' has been added.
- Property 'PvrAiring.onGoing' has been added.
- Property 'PvrAiring.onGoingStatus' has been removed.
- Property 'Airing.onGoingStatus' has been removed., Error Code=10}: file /BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-902.0.48/src/swift/stdlib/public/core/ErrorType.swift, line 184
2018-06-29 14:22:02.765986+0900 WatchAir[26915:11744822] Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=io.realm Code=10 "Migration is required due to the following errors:
- Property 'Airing.onGoing' has been added.
- Property 'PvrAiring.onGoing' has been added.
- Property 'PvrAiring.onGoingStatus' has been removed.
- Property 'Airing.onGoingStatus' has been removed." UserInfo={NSLocalizedDescription=Migration is required due to the following errors:
- Property 'Airing.onGoing' has been added.
- Property 'PvrAiring.onGoing' has been added.
- Property 'PvrAiring.onGoingStatus' has been removed.
- Property 'Airing.onGoingStatus' has been removed., Error Code=10}: file /BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-902.0.48/src/swift/stdlib/public/core/ErrorType.swift, line 184
위와 같은 오류가 발생하면
지금 개발중인 앱을 아이폰에서 삭제 후 다시 시작하면 문제 없이 기동됩니다.
schema 에 저장되어있는 파일을 변경/추가 할때 DB가 꼬이는 문제가 있습니다.
잘 생각해보면 realm 이 object-c 에서 사용되던 coredata 와 비슷하단점을 2일이 지나고서 인식했음..
그래서 구글링 검색결과 DB column값을 변경하려면 아이폰에 설치되어있는 앱을 지우고 새로 빌드하면 제대로 실행됨.