macos调用退出全屏函数时报错

代码:
NSDictionarydictionaryWithObject:[NSNumberNumber With Bool : YES ] for Key :NSFullScreenModeSetting];
[ self.view exitFullScreenModeWithOptions:dic];

运行报错:void * _Nullable NSMapGet(NSMapTable * _Nonnull, const void * _Nullable): map table argument is NULL