Last active
February 28, 2016 23:18
-
-
Save robertmryan/625b2e279a8f013c23e9 to your computer and use it in GitHub Desktop.
This file contains 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
func myFunction() -> NSArray { | |
var array: NSArray | |
Synchronized(someObject) { | |
// Stuff to do. | |
// don't "return" the array, here, but just set that local var above | |
} | |
return array // you can only "return" the `NSArray` object from outside the `Synchronized` closure | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment