Returns a Cocoa window created from a Carbon window.


convenience init?(windowRef: UnsafeMutableRawPointer)



The Carbon WindowRef object to use to create the Cocoa window.

Return Value

A Cocoa window created from windowRef.


For more information on Carbon-Cocoa integration, see Using a Carbon User Interface in a Cocoa Application in Carbon-Cocoa Integration Guide.

Special Considerations

For historical reasons, contrary to normal memory management policy initWithWindowRef: does not retain windowRef. It is therefore recommended that you make sure you retain windowRef before calling this method. If windowRef is still valid when the Cocoa window is deallocated, the Cocoa window will release it.

See Also

Working with Carbon

var windowRef: UnsafeMutableRawPointer

The Carbon WindowRef associated with the window, creating one if necessary.