我已经设置了一个PurchaseViewController
工作正常的程序,除了多个应用程序商店登录,我意识到这是SKPaymentQueue.defaultQueue().addTransactionObserver(self)
. 我需要将其插入到函数Appdelegate
的类中DidFinishLaunchingWithOptions
。当我这样做时:
import UIKit
import StoreKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, SKPaymentTransactionObserver {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
{
UINavigationBar.appearance().barTintColor = UIColor(red: 0/255.0, green: 115/255.0, blue: 158/255.0, alpha: 1.0)
UINavigationBar.appearance().tintColor = UIColor.whiteColor()
UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName : UIColor.whiteColor()]
SKPaymentQueue.defaultQueue().addTransactionObserver(self)
// Override point for customization after application launch.
return true
}
Run Code Online (Sandbox Code Playgroud)
我明白了Type Appdelegate does not conform to protocol "SKPaymentTransactionObserver
。
有人可以指出我哪里出错了吗?
归档时间: |
|
查看次数: |
5164 次 |
最近记录: |