In Snowy, Apple changed how to use the pasteboard.
Rather than getting data from your objects, archiving it and placing it on the pasteboard, the data gets written directly to the pasteboard if your custom class implements the NSPasteboardWriting and NSPasteboardReading protocols.
The NSPasteboardReading protocol has a method (initWithPasteboardPropertyList
fType
for creating a new instance from the pasted data, but also initWithCoder: is used.
However, you are not supposed to used init methods for NSManagedObject's. NSManagedObject also doesn't implement the NSCoding protocol. Thus my question: how then are you supposed to paste a nsmanagedobject?
Any idea why they changed the way pasteboards operate?
Thanks.
Rather than getting data from your objects, archiving it and placing it on the pasteboard, the data gets written directly to the pasteboard if your custom class implements the NSPasteboardWriting and NSPasteboardReading protocols.
Code:
NSArray *objectsToCopy = <#An array of objects#>;
BOOL OK = [pasteboard writeObjects:objectsToCopy];
The NSPasteboardReading protocol has a method (initWithPasteboardPropertyList
However, you are not supposed to used init methods for NSManagedObject's. NSManagedObject also doesn't implement the NSCoding protocol. Thus my question: how then are you supposed to paste a nsmanagedobject?
Any idea why they changed the way pasteboards operate?
Thanks.