का उपयोग हटाई गई है, मैं निम्नलिखित कोड है:प्रयोग करें '#selector' के बजाय
func setupShortcutItems(launchOptions: [NSObject: AnyObject]?) -> Bool {
var shouldPerformAdditionalDelegateHandling: Bool = false
if (UIApplicationShortcutItem.respondsToSelector("new")) {
self.configDynamicShortcutItems()
// If a shortcut was launched, display its information and take the appropriate action
if let shortcutItem: UIApplicationShortcutItem = launchOptions?[UIApplicationLaunchOptionsShortcutItemKey] as? UIApplicationShortcutItem {
// When the app launched at the first time, this block can not called.
self.handleShortCutItem(shortcutItem)
// This will block "performActionForShortcutItem:completionHandler" from being called.
shouldPerformAdditionalDelegateHandling = false
} else {
// normal app launch process without quick action
self.launchWithoutQuickAction()
}
} else {
// Less than iOS9 or later
self.launchWithoutQuickAction()
}
return shouldPerformAdditionalDelegateHandling
}
मैं निम्नलिखित UIApplicationShortcutItem.respondsToSelector("new")
पर "चेतावनी", जो कहते हैं मिलती है:
उपयोग हटाई गई है, उपयोग '#selector' के बजाय
चेतावनी के साथ स्वचालित रूप से कोड की जगह:
UIApplicationShortcutItem.respondsToSelector(#selector(FBSDKAccessToken.new))
हालांकि इस संकलन नहीं है क्योंकि new()
unavailabe है। इस मामले में मुझे क्या उपयोग करना चाहिए?
इसे जांचें ... आपको कुछ मिल सकता है http://stackoverflow.com/questions/36147831/syntax-selector-swift-2-2 –
आप चयनकर्ता 'नया' के लिए क्यों परीक्षण कर रहे हैं? मुझे कोई नया कोड नहीं दिखाई देता है जो यहां 'नया' संदेश भेजता है। –