LoginSignup
1
1

More than 3 years have passed since last update.

アプリにバンドルした.realmをiOSシミュレーターでは直接開けるのにiOS実機で開けない。

Last updated at Posted at 2019-10-03

とりあえず解決としてはConfigurationのreadOnlyをtrueにする。

    let config = Realm.Configuration(fileURL:~~~~)
        config.readOnly = true

そもそもバンドルディレクトリはread only。
変更可能にしたいときはdocumentsディレクトリなどにコピーしてから開かなくてはならない。
逆にシミュレーターだと開けてしまうのは、Macの方の設定に依存しているからということらしい。

参照:Unable to open bundled realm file on real device #4809

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1