XMPPMessageArchiving_Message_CoreDataObject classSwift 3 XMPPframework ordnungsgemäße Verwendung von willInsert() und didUpdate() in XMPPMessageArchiving_Message_CoreDataObject
import UIKit
open class XMPPMessageArchiving_Message_CoreDataObject : NSManagedObject {
open var message: XMPPMessage! // Transient (proper type, not on disk)
open var messageStr: String! // Shadow (binary data, written to disk)
/**
* This is the bare jid of the person you're having the conversation with.
* For example: [email protected]
*
* Regardless of whether the message was incoming or outgoing,
* this will represent the "other" participant in the conversation.
**/
open var bareJid: XMPPJID! // Transient (proper type, not on disk)
open var bareJidStr: String! // Shadow (binary data, written to disk)
open var body: String!
open var thread: String!
open var outgoing: NSNumber! // Use isOutgoing
open var isOutgoing: Bool // Convenience property
open var composing: NSNumber! // Use isComposing
open var isComposing: Bool // Convenience property
open var timestamp: Date!
open var streamBareJidStr: String!
/**
* This method is called immediately before the object is inserted into the managedObjectContext.
* At this point, all normal properties have been set.
*
* If you extend XMPPMessageArchiving_Message_CoreDataObject,
* you can use this method as a hook to set your custom properties.
**/
open func willInsert()
/**
* This method is called immediately after the message has been changed.
* At this point, all normal properties have been updated.
*
* If you extend XMPPMessageArchiving_Message_CoreDataObject,
* you can use this method as a hook to set your custom properties.
**/
open func didUpdate()
}
Hallo,
Ich bin ziemlich neu mit Swift 3 und XMPPframework
, ich versuche, neue hinzufügen Spalten in den Kerndaten von XMPPMessageArchiving_Message
Datenmodell, das zusätzliche Daten für meine Anwendungsfälle aufzeichnet, in der Klasse heißt es, dass Sie erweitern müssen, um Ihre benutzerdefinierten Eigenschaften hinzuzufügen. Es scheint, dass die Erweiterung der Klasse für mich nicht funktioniert. unten wird die Probe Erweiterungsblock willInsert()
extension XMPPMessageArchiving_Contact_CoreDataObject {
open func willInsert(){
print("In willInsert()")
//to-do additional data
}
}
Ist dies der richtige Weg, um den Haken erwähnt in der Klasse zu testen, um zu nennen?
Vielen Dank im Voraus für die Antwort ..
bitte Ihren Code als Text mit Code-Markup veröffentlichen, nicht als Bild – JimHawkins