iOS 4.1+ アプリでフレームワーク GKAchievementNotification (https://github.com/typeoneerror/GKAchievementNotification) を使用しています。このアプリは Apple によって承認されています (アプリ ストアにあります) が、iOS 4.3.3 でクラッシュするようです。クラッシュログは次のとおりです。
OS Version: iPhone OS 4.3.3 (8J3)
Report Version: 104
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x00000001, 0xe7ffdefe
Crashed Thread: 0
Dyld Error Message:
Symbol not found: _OBJC_CLASS_$_GKNotificationBanner
Referenced from: /var/mobile/Applications/08289A0B-7AD3-4E37-B29F-A EDFE97B7ACA/PolarDefense.app/PolarDefense
Expected in: /System/Library/Frameworks/GameKit.framework/GameKit
in /var/mobile/Applications/08289A0B-7AD3-4E37-B29F-AEDFE97B7ACA/PolarDefense.app/PolarDefense
Dyld Version: 191.3
フレームワークが、サポートしていない iOS バージョン (5.0 より前の iOS) の GKNotificationBanner を正しく破棄していないようです。
エラーは次のコードにあると思いますが、何が間違っていると思いますか?
@implementation GKAchievementHandler(private)
- (void)displayNotification:(GKAchievementNotification *)notification {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 50000
if ([GKNotificationBanner class]) {
[GKNotificationBanner showBannerWithTitle:notification.title
message:notification.message
completionHandler:^{
[self didHideAchievementNotification:notification];
}
];
} else
#endif
{
[_topView addSubview:notification];
[notification animateIn];
}
}
@end
GKNotificationBanner はさらにいくつかの場所で参照されますが、常に #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 50000 で囲まれています。
では、なぜクラッシュするのでしょうか。(そして、なぜリリースモードでのみ?)
展開ターゲットは 4.1 です。クラスが存在するかどうかの実行時チェックは 4.2 でのみサポートされていることを読みました。これが問題でしょうか?