To be able to run the app or view even when phone has a low storage
When going to the view, don't crash
It crashes with this error:
Thread 10: Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=io.realm Code=1 "fcntl() inside prealloc() failed allocating 1184 bytes, new_size=1184, cur_size=0, allocated_size=0, event: No space left on device" UserInfo={NSLocalizedDescription=fcntl() inside prealloc() failed allocating 1184 bytes, new_size=1184, cur_size=0, allocated_size=0, event: No space left on device, Error Code=1}
self.token = realm.objects(Data.self).sorted(byKeyPath: "date", ascending: false).observe({ change in ...
Realm framework version: 3.14.1
Xcode version: 10.2
iOS/OSX version: 10.14.4
If you don't want to crash when an i/o error occurs then handle the error with do/catch rather than using try!.
Most helpful comment
If you don't want to crash when an i/o error occurs then handle the error with do/catch rather than using
try!.