* この質問は、Swift でリモート通知を登録する方法ではないことに注意してください。私の質問は、iOS8 と iOS7 の両方を実行しているデバイスで実行するときに機能するコードを Swift で記述する方法です。私が投稿したコードは、Xcode beta 1 から 5 まではそうしていましたが、beta 6 ではリンカ エラーが発生するようになりました。だから私の質問は、ベータ 6 の新しいリンカー エラーを回避するために物事を変更する方法です。 *
Xcode Beta 6 で次のリンク エラーが発生します。
Undefined symbols for architecture arm64:
"__TFSsoi1oUSs17_RawOptionSetType_USs21BitwiseOperationsTypeSs9Equatable__FTQ_Q__Q_", referenced from:
__TFC12My_cWireless11AppDelegate29registerForRemoteNotificationfS0_FT_T_ in AppDelegate.o
ベータ 1 ~ 5 で問題なくコンパイル/リンク/実行された次のコードの場合。
func registerForRemoteNotification()
{
let registerForRemoteNotificationsMethodExists = UIApplication.sharedApplication().respondsToSelector(Selector("registerForRemoteNotifications"))
if registerForRemoteNotificationsMethodExists
{
UIApplication.sharedApplication()?.registerForRemoteNotifications()
}
else
{
// Fall back to using iOS7 as the code is not running on an iOS 8 device
UIApplication.sharedApplication()?.registerForRemoteNotificationTypes(UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound | UIRemoteNotificationType.Alert)
}
}
最新のベータ版とのリンクが停止したのはなぜですか? Xcode Beta 6 で明らかになったコードに問題はありますか?