Closed GZaccaroni closed 8 years ago
Hello! Thanks for reporting this problem, and sorry for the inconvenience.
Would you be willing to provide additional information in order to help us debug this issue? In particular:
Database
singleton? Are you using the default initializer (e.g. Realm()
), or another method? How are you handling any possible errors that the initializer might throw?Any other contextual information you can provide would be greatly appreciated. Thanks!
Hi @austinzheng, thanks for the reply.
Definition of the model:
class Impostazioni: Object {
dynamic var aID = 0
dynamic var chiave = ""
dynamic var valore = ""
}
I'm using a static variable defined inside a class as
private static let realm = try! Realm()
I'm trying to fetch results from a thread and it sporadically happen (more than 1000 users experiences that crash)
Thanks! We will be investigating your bug report. I will let you know if I have further questions.
Hi @GZaccaroni,
Based on your stack trace and the information you provided it seems the problem is that the Realm()
initializer is throwing an uncaught error, which causes the program to be terminated due to the try!
.
Since this should happen only rarely (and almost certainly not for 30% of your users), would you be willing to change your code to catch the error and log the error message? This won't fix your problem, unfortunately, but it will provide us with additional data that can help us determine the root cause. (You can read more about how to extract the error message here: https://realm.io/docs/swift/latest/#error-handling)
Let me know if you have any questions or concerns, and thanks for your patience.
Ok i'll try to handle it, thanks!
Il giorno 10 mag 2016, alle ore 22:26, Austin Zheng notifications@github.com ha scritto:
Hi @GZaccaroni,
Based on your stack trace and the information you provided it seems the problem is that the Realm() initializer is throwing an uncaught error, which causes the program to be terminated due to the try!.
Since this should happen only rarely (and almost certainly not for 30% of your users), would you be willing to change your code to catch the error and log the error message? This won't fix your problem, unfortunately, but it will provide us with additional data that can help us determine the root cause. (You can read more about how to extract the error message here: https://realm.io/docs/swift/latest/#error-handling)
Let me know if you have any questions or concerns, and thanks for your patience.
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub
@GZaccaroni What were your findings?
Goals
What do you want to achieve? Getting a value from a database, 30% of my users experience that error
Expected Results
What did you expected to happen? Get a row from a database
Actual Results
What did happened instead?
e.g. the stack trace of a crash
Steps to Reproduce
What are steps we can follow to reproduce this issue? I think that is something concerning background access, but i have done all the things described in the documentation.
Code Sample
Provide a code sample or test case that highlights the issue. If relevant, include your model definitions. For larger code samples, links to external gists/repositories are preferred. Alternatively share confidentially via mail to help@realm.io. Full Xcode projects that we can compile ourselves are ideal!
if let ret = Database.realm.objects(Impostazioni).account().filter(NSPredicate(format: "chiave = %@", chiave)).first { return ret.valore }else{ return "" }
Version of Realm and Tooling
In the CONTRIBUTING guidelines, you will find a script, which will help determining these versions.
Realm version: ? 0.101.0 Xcode version: ? 7.3 iOS/OSX version: ? 9.3.1 Dependency manager + version: ? CocoaPods 1.0.0.rc.2