let realm=try!Realm (path: path name you want to read)
It used to be possible as shown in , but after the Realm version reaches 1.0,
Argument labels' (path:) 'do not match any available overloads
The warning message now appears.
How do I resolve this warning?
Is there an alternative argument to path?
The path
argument was recently changed to the parameter fileURL
to match Swift's standard library.
https://realm.io/news/realm-objc-swift-0.99.0/
From now on, use Realm(fileURL:)
or
try!Realm (fileURL:NSURL(fileURLWithPath: "/path/to/file")))
Configure the file path using Realm.Configuration
.
try!Realm(configuration:Realm.Configuration(fileURL:NSURL(fileURLWithPath:"/path/to/file"))))
© 2024 OneMinuteCode. All rights reserved.