GKNotificationBanner在iOS 4.3.3 [英] GKNotificationBanner on iOS 4.3.3

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

问题描述

我使用的框架GKAchievementNotification(https://github.com/typeoneerror/GKAchievementNotification)在我的iOS 4.1或更高版本的应用程序。这个程序是得到苹果的批准(是应用程序商店),但似乎崩溃在iOS 4.3.3。崩溃日志如下:

  OS版本:iPhone OS 4.3.3(8J3)
报告版本:104异常类型:EXC_BREAKPOINT(SIGTRAP)
异常codeS:00000001,0xe7ffdefe
坠毁主题:0dyld的错误信息:
  找不到符号:_OBJC_CLASS _ $ _ GKNotificationBanner
  在/ var /移动/应用/ 08289A0B-7AD3-4E37-B29F-A EDFE97B7ACA / PolarDefense.app / PolarDefense:从引用
  预计:/System/Library/Frameworks/GameKit.framework/GameKit
  在/var/mobile/Applications/08289A0B-7AD3-4E37-B29F-AEDFE97B7ACA/PolarDefense.app/PolarDefense
  dyld的版本:191.3

好像框架是不正确丢弃GKNotificationBanner为它不(的iOS 5.0之前)支持的iOS版本。

我假设错误主要表现在以下code,你怎么想错了?

  @implementation GKAchievementHandler(私人)
- (无效)displayNotification:(GKAchievementNotification *)通知{
 #如果__IPHONE_OS_VERSION_MAX_ALLOWED> = 50000
  如果([GKNotificationBanner类]){
    [GKNotificationBanner showBannerWithTitle:notification.title
                                      消息:notification.message
                            completionHandler:^ {
                                [个体经营didHideAchievementNotification:通知]
                            }
     ];
  }其他
 #万一
  {
    [_topView addSubview:通知]
    [通知animateIn]
  }
}
@结束

GKNotificationBanner是referensed在几个地方,但始终#如果__IPHONE_OS_VERSION_MAX_ALLOWED> = 50000

那么怎么来的崩溃? (为什么只在释放模式?)

部署目标为4.1。我现在读的运行时间,如果一类存在于检查4.2仅支持。难道这是问题吗?


解决方案

认为它可能有一个需要链接到的GameKit涉及到了我。将其更改为弱并将其提交给应用程序商店(第三次)。

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

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 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?)

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?

解决方案

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).

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

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