I’m trying to update the code to Xcode 9 & Swift 4. I’ve implemented the cut:, copy:, & paste: methods according to page 325. There are no compiler warnings or errors. When I run the program, I cannot use the Cut, Copy, or Paste commands. The menu commands are disabled and using the Command-key shortcuts fails. The MainMenu.xib shows the methods correctly connected to the first responder.
This is what the updated versions of the methods look like:
@IBAction func cut(sender: AnyObject?) {
writeToPasteboard(pasteboard: NSPasteboard.general)
intValue = nil
}
@IBAction func copy(sender: AnyObject?) {
writeToPasteboard(pasteboard: NSPasteboard.general)
}
@IBAction func paste(sender: AnyObject) {
_ = readFromPasteboard(pasteboard: NSPasteboard.general)
}
Any one have any ideas about why my @IBAction methods are not getting hooked up correctly leaving the Cut/Copy/Paste commands unusable?