Created
November 23, 2014 12:33
-
-
Save tonyarnold/4db0546cfbcceccf5c8f to your computer and use it in GitHub Desktop.
Demonstrates a bug in Xcode 6.1.1 when trying to call super within a closure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
class CocoaBotsDocument : NSDocument { | |
override func saveToURL(url: NSURL, ofType typeName: String, forSaveOperation saveOperation: NSSaveOperationType, completionHandler: (NSError!) -> Void) { | |
performAsynchronousFileAccessUsingBlock() { fileAccessCompletionHandler in | |
// I should be able to call: | |
super.saveToURL(url, ofType: typeName, forSaveOperation: saveOperation) { error in } | |
// And this _looks_ like it should work, but doesn't: | |
NSDocument.saveToURL(self)(url, ofType: typeName, forSaveOperation: saveOperation) { error in } | |
} | |
} | |
} | |
// There is no sadness like the death of optimism |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment