NSOpenPanel() crash in Swift 1.1
NSOpenPanel() crash in Swift 1.1
- Subject: NSOpenPanel() crash in Swift 1.1
- From: Bill Cheeseman <email@hidden>
- Date: Fri, 20 Feb 2015 07:45:15 -0500
I'm writing a single-window utility application in Xcode 6.1.1 on OS X 10.10.2 using Swift 1.1. This code statement crashes:
let panel = NSOpenPanel()
For the first several days after I added this statement, it worked correctly -- the panel opened and I was able to select a file in the panel and dismiss it and process the file. Then yesterday, after changing some unrelated code elsewhere in the application, it started crashing, and now it always crashes.
When execution stops at the statement in issue, the debug log entry says "Unable to simultaneously satisfy constraints", and it lists a bunch of constraints apparently in the open panel provided by the system. It says it will "attempt to recover by breaking" one of the constraints, but when I continue execution I get the log entry "Method cache corrupted. This may be a message to an invalid object, or a memory error somewhere else," with additional information that I don't know how to interpret.
Googling the problem, I find one thread a few months ago describing the identical crash (including the message about incompatible constaints) stating that this is a known Apple bug in NSOpenPanel and that there is no workaround.
Does anybody know whether this has been fixed or a workaround exists? Reading the Swift 1.2 beta release notes gives me no comfort, and I hesitate to move my project to OS X 10.10.3 beta just to find out that it still doesn't work. I can't imagine that such an important Cocoa object would be left inoperable for very long.
--
Bill Cheeseman - email@hidden <mailto:email@hidden>
--
Bill Cheeseman - email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden