10.7 より前の OS バージョンで NSWindowWillEnterFullScreenNotification を追加しないようにするにはどうすればよいですか。これは OS 10.7 以降でのみ使用可能であり、10.7 以降でこの通知を使用したいのですが、以前の OS バージョンで実行するとアプリケーションがクラッシュしました。クラッシュ ログを確認したところ、Symbol not found NSWindowWillEnterFullScreenNotification と表示されていました
現在、これを使用してOSのバージョンを確認しています
if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_5) {
/* On a 10.5.x or earlier system */
}
else if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_6) {
/* On a 10.6 - 10.6.x system */
} else {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(willEnterFull:)
name:NSWindowWillEnterFullScreenNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didExitFull:)
name:NSWindowDidExitFullScreenNotification
object:nil];
}
しかし、アプリは起動するとすぐに以前のバージョンでクラッシュしました。
NDAのためにログでアプリ名をXYZに変更しましたが、クラッシュログは次のとおりです
Process: XYZ [53319]
Path: /Applications/XYZ.app/Contents/MacOS/XYZ
Identifier: com.XYZ.XYZ
Version: 2.0.5 (2.0.5)
Code Type: X86 (Native)
Parent Process: launchd [224]
Date/Time: 2012-10-28 07:44:11.717 -0500
OS Version: Mac OS X 10.6.8 (10K549)
Report Version: 6
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Crashed Thread: 0
Dyld Error Message:
Symbol not found: _NSWindowDidExitFullScreenNotification
Referenced from: /Applications/XYZ.app/Contents/MacOS/XYZ
Expected in: /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
in /Applications/XYZ.app/Contents/MacOS/XYZ