How to load NSView from Xib properly?

My code:

```
var topLevelArray: NSArray? = nil
let outputValue = AutoreleasingUnsafeMutablePointer<NSArray>(&topLevelArray)

if Bundle.main.loadNibNamed("RadioPlayerView", owner: nil, topLevelObjects: outputValue) {
    let views = outputValue.pointee
    return views.firstObject as! RadioPlayerView
}

topLevelArray = nil
return nil

```

The problem is "outputValue" is a auto-release pointer, and as soon as I return from the function, the program crash with ACCESS\_BAD\_ADDRESS