You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Questions: If you have questions about how to use Realm, ask on StackOverflow.
We monitor the realm tag.
Feature Request: Just fill in the first two sections below.
Bugs: To help you as fast as possible with an issue please describe your issue
and the steps you have taken to reproduce it in as many details as possible.
Thanks for helping us help you! :-)
Please remove this line and all above before submitting.
Goals
What do you want to achieve?
Expected Results
What did you expected to happen?
I expected to be able to open the realm file.
I created the realm using realm-browser from a csv file
Actual Results
What did happened instead?
2017-03-2617:16:56.542721 Mobile[490:246750]*** Terminating
app due to uncaught exception 'RLMException', reason:
'Only 'string' and 'int' properties can be designated the primary key'
func getHebronDestinations()->Results<DestinationREALM>{Log.info?.message("\(Realm.Configuration.defaultConfiguration.fileURL!)")letbundleUrl=Bundle.main.url(forResource:"default", withExtension:"realm")letconfig=Realm.Configuration(
fileURL: bundleUrl,
readOnly: true,
schemaVersion:0,
migrationBlock:{ migration, oldSchemaVersion in
if (oldSchemaVersion <1){Log.info?.message("\(oldSchemaVersion)")Log.info?.message("wtf")}
if (oldSchemaVersion <2){Log.info?.message("\(oldSchemaVersion)")}Log.info?.message("Realm migration did run")// Log to know migration was executed})letrealm=try!Realm(configuration: config)letnaoHebronResults= realm
.objects(DestinationREALM.self).filter("destinationRegionCode == 'nao' AND destinationCode == 'heb'")Log.info?.message("\(naoHebronResults)")
for res in naoHebronResults{Log.info?.message(res.destinationName)}return naoHebronResults
}
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!
The error message suggests that you have a primaryKey() method on one of your Object subclasses that's returning the name of a property whose type is not Int or String. Can you do a search in your project for a function named primaryKey to see if you've overlooked one?
All models you've defined are in the Realm file unless you explicitly specify a subset of the schema to use by setting Realm.Configuration.objectTypes.
Goals
What do you want to achieve?
Expected Results
What did you expected to happen?
I expected to be able to open the realm file.
I created the realm using realm-browser from a csv file
Actual Results
What did happened instead?
Steps to Reproduce
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!
Version of Realm and Tooling
In the CONTRIBUTING guidelines, you will find a script,
which will help determining these versions.
Realm version: latest
Xcode version: latest
iOS/OSX version: latest
Dependency manager + version: carthage latest
The text was updated successfully, but these errors were encountered: