You just pass a reference like so:
var error: NSError?
var results = context.executeFetchRequest(request, error: &error)
if error != nil {
println("Error executing request for entity \(entity)")
}
Two important points here:
NSError?is an optional (and initialized tonil)- you pass by reference using the
&operator (e.g.,&error)
See: Using swift with cocoa and objective-c