我正在尝试为我的 swift 应用程序设置通知,当我输入以下内容时:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
//Tell the app to ask the user for permission
registerForLocalNotifications()
return true
}
它返回使用未解析的标识符“registerForLocalNotifications”
。
有什么想法吗?
最佳答案
您正在调用属于 ExternalAccessory
框架的函数,就像它是您自己的类的函数一样。
我认为你需要...
import ExternalAccessory
...在您的导入中,然后...
EAAccessoryManager.sharedAccessoryManager().registerForLocalNotifications()
关于swift - 使用 registerForLocalNotifications 时 Unresolved external 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36611417/