Closed qq565999484 closed 7 years ago
Please provide the information that was requested in the new issue template and described in our documentation on filing issues.
Also, please provide your code including at least the definition of the model. We have never seen such a log. I think that there is probably something wrong with the definition of the model.
@qq565999484
import UIKit
import RealmSwift
class Dog: Object
{
@objc dynamic var name = ""
@objc dynamic var age = 0
override var description: String { return "dog {\(name), \(age)}" }
}
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
let myDog = Dog(value: ["name":"1xasxa22","age" : 2])
let myDog2 = Dog()
myDog2.name = "DeLorean"
myDog2.age = 111
let realm = try! Realm(configuration: Realm.Configuration(inMemoryIdentifier: "TemporaryRealm"))
try! realm.write {
realm.add(myDog)
realm.add(myDog2)
}
return true
}
@kishikawakatsumi
import UIKit
import RealmSwift
class Dog: Object
{
dynamic var name = ""
dynamic var age = 0
override var description: String { return "dog {\(name), \(age)}" }
}
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
let myDog = Dog(value: ["name":"1xasxa22","age" : 2])
let myDog2 = Dog()
myDog2.name = "DeLorean"
myDog2.age = 111
let realm = try! Realm(configuration: Realm.Configuration(inMemoryIdentifier: "TemporaryRealm"))
try! realm.write {
realm.add(myDog)
realm.add(myDog2)
}
return true
}
My Realm.FrameWork was towed directly to the project
@qq565999484, did you see the list of information requested in the new issue template and in our documentation on filing issues? It appears that the majority of the information requested in those two places has not yet been provided.
Sorry, I may not understand what you mean because of my low level
Can you send us your project? You can make it into a zip file and attach it to this GitHub ticket. Then we can run it and see what is happening.
RealmSwiftDemo.zip I'm sorry, because I will upload limit, to cancel the inside of the Realm.framework and RealmSwift.framework. You need to add.Framework.
Which version of Realm are you using? That's one of the pieces of information that we requested earlier.
realm-swift-2.10.0.zip=>swift-3.1 xcode: xcode8.3.3 OS:10.12.6
I opened your project in Xcode and note that you only have the RealmSwift framework defined in your project navigator. Our instructions say you need both the RealmSwift.framework
and Realm.framework
. It's possible you copied the Realm.framework
but didn't add it to your project definition. Can you add Realm.framework
to your application and try again please?
Once I added both frameworks, the project built and ran without errors on my computer.
thanks。
# Thank you very much for your help
2017-08-23 18:17:48.548 RealmSwiftDemo[20671:3180440] NSForwarding: warning: object 0x103cd97b0 of class 'RealmSwiftDemo.Dog' does not implement methodSignatureForSelector: -- did you forget to declare the superclass of 'RealmSwiftDemo.Dog'? 2017-08-23 18:17:48.549 RealmSwiftDemo[20671:3180440] NSForwarding: warning: object 0x103cd97b0 of class 'RealmSwiftDemo.Dog' does not implement doesNotRecognizeSelector: -- abort