2016-04-13 40 views
0

當我試圖設置通知我迅速的應用程序,當我鍵入此解析外部:使用registerForLocalNotifications

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

你調用屬於ExternalAccessory框架就好像它是你自己的類的功能的功能。

我想你需要...

import ExternalAccessory 

...您的進口中,再後來......

EAAccessoryManager.sharedAccessoryManager().registerForLocalNotifications()