我正在尝试为我的swift应用设置通知,当我输入时:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
//Tell the app to ask the user for permission
registerForLocalNotifications()
return true
}
返回Use of unresolved identifier 'registerForLocalNotifications'
。
任何想法?
答案 0 :(得分:0)
您正在调用属于ExternalAccessory
框架的函数,就好像它是您自己的类的函数一样。
我认为你需要......
import ExternalAccessory
...在您的导入中,然后再...
EAAccessoryManager.sharedAccessoryManager().registerForLocalNotifications()