iOS 4.3.3 上的 GKNotificationBanner [英] GKNotificationBanner on iOS 4.3.3

查看:28
本文介绍了iOS 4.3.3 上的 GKNotificationBanner的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 iOS 4.1+ 应用程序中使用框架 GKAchievementNotification (https://github.com/typeoneerror/GKAchievementNotification).此应用已获得 Apple 批准(在应用商店中),但似乎在 iOS 4.3.3 上崩溃.崩溃日志如下:

I am using the framework GKAchievementNotification (https://github.com/typeoneerror/GKAchievementNotification) in my iOS 4.1+ app. This app is approved by Apple (is on app store) but seems to crash on iOS 4.3.3. The crash log is the following:

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 版本(iOS 5.0 之前的版本),该框架似乎没有正确丢弃 GKNotificationBanner.

Seems like the framework is not correctly discarding GKNotificationBanner for iOS versions which it does not support (iOS prior to 5.0).

我假设错误在于以下代码,您认为它有什么问题?

I am assuming the error lies in the following code, what do you think it wrong?

@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 包围

GKNotificationBanner is referensed in a few more places but always surrounded by #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 50000

那它怎么会崩溃呢?(为什么只在发布模式下?)

So how come it crashes? (And why only in release mode?)

部署目标是 4.1.我现在读到只有 4.2 才支持运行时检查类是否存在.这可能是问题吗?

Deployment target is 4.1. I read now that the run-time checking of if a class exist is only supported in 4.2. Could this be the problem?

推荐答案

认为这可能与我需要链接到 GameKit 相关.将其改成weak并提交到App Store(第三次).

Think it could be related to me having a required linking to GameKit. Will change it to weak and submit it to App Store (for the third time).

这篇关于iOS 4.3.3 上的 GKNotificationBanner的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆