मैं क्या उत्पादन किया गया था पिछले नवंबर (here), लेकिन मेरे पुराने कोड Xcode 7 में किसी भी अधिक मेरे लिए काम नहीं लगता है परे registerUserNotificationSettings पर किसी भी दस्तावेज और स्विफ्ट 2.स्विफ्ट 2 में रजिस्टर यूज़र नोटिफिकेशन सेटिंग्स में परिवर्तन?
मेरे पास है खोजने के लिए नहीं कर पा रहे अनुप्रयोग प्रतिनिधि में इस कोड:
'Element.Protocol' एक सदस्य 'चेतावनी'
नामित नहीं है:let endGameAction = UIMutableUserNotificationAction() endGameAction.identifier = "END_GAME" endGameAction.title = "End Game" endGameAction.activationMode = .Background endGameAction.authenticationRequired = false endGameAction.destructive = true let continueGameAction = UIMutableUserNotificationAction() continueGameAction.identifier = "CONTINUE_GAME" continueGameAction.title = "Continue" continueGameAction.activationMode = .Foreground continueGameAction.authenticationRequired = false continueGameAction.destructive = false let restartGameCategory = UIMutableUserNotificationCategory() restartGameCategory.identifier = "RESTART_CATEGORY" restartGameCategory.setActions([continueGameAction, endGameAction], forContext: .Default) restartGameCategory.setActions([endGameAction, continueGameAction], forContext: .Minimal) application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: (NSSet(array: [restartGameCategory])) as Set<NSObject>))
मैं अब कोड की अंतिम सीमा पर निम्नलिखित दो त्रुटियों का सामना करना
और
प्रकार का एक तर्क सूची के साथ 'registerUserNotificationSettings' '(UIUserNotificationSettings)' आह्वान नहीं किया जा सकता
मैं किसी भी परिवर्तन के बारे में जानकारी के लिए खोज की है, लेकिन मैं नहीं मिल सकता है कुछ भी। क्या मुझसे साफ़ - साफ़ कुछ चीज़ चूक रही है?
यह निश्चित रूप से मेरे मूल कोड की तुलना में बहुत साफ दिखता है - धन्यवाद, @ 0x7fffffff। –