键入'键'限制为非协议类型' String'

时间:2017-07-12 14:29:25

标签: ios xcode amazon-web-services swift3 compiler-errors

以下文件包含以下错误:

Type 'Key' constrained to non-protocol type 'String'

没有任何行号。

//
//  UserProfile+Util.swift
//  MySampleApp
//
//  Modified on 05/06/2016.
//
//

import AWSMobileHubHelper

extension UserProfile {

    class func getDeviceArn() -> String? {

        let pushManager: AWSPushManager = AWSPushManager.defaultPushManager()



        if let _endpointARN = pushManager.endpointARN {
            // pushManager.enabled = true
            return _endpointARN
        }else{
            pushManager.registerForPushNotifications()
        }

        return nil
    }

}

据我所知,当扩展程序与'密钥一起使用时,会发生此错误。 我没有用钥匙扩展课程。这让我疯了好几天。

我知道以下问题,但它无法解决我的问题:<unknown>:0: error: type 'Key' constrained to non-protocol type 'String'

0 个答案:

没有答案
相关问题