类型“ Notification.Name”(又名“ NSNotification.Name”)没有成员“ UIDevice”

时间:2019-02-14 14:47:24

标签: swift swift4.2

这是我之前使用过的代码。

-- List of all identifiers to pass to the function (GetGrappageParLien531)
select id_personne_groupe from t_groupe where idgroupe > 0

-- "Main query"
select
case grap.niveau when 0 Then p.identifiantuniversel + ' - ' + Isnull(pm.SIREN,'(pas de siren)') + ' - ' + pm.raisonsociale else '' end as col1,
case grap.niveau when 1 Then p.identifiantuniversel + ' - ' + Isnull(pm.SIREN,'(pas de siren)') + ' - ' + pm.raisonsociale else '' end as col2,
case grap.niveau when 2 Then p.identifiantuniversel + ' - ' + Isnull(pm.SIREN,'(pas de siren)') + ' - ' + pm.raisonsociale else '' end as col3,
pm.SIREN
from GetGrappageParLien531(23) grap
join t_personne p on grap.Pers_filiale = p.idpersonne
join t_personne_morale pm on pm.idpersonne = p.idpersonne

select
case grap.niveau when 0 Then p.identifiantuniversel + ' - ' + Isnull(pm.SIREN,'(pas de siren)') + ' - ' + pm.raisonsociale else '' end as col1,
case grap.niveau when 1 Then p.identifiantuniversel + ' - ' + Isnull(pm.SIREN,'(pas de siren)') + ' - ' + pm.raisonsociale else '' end as col2,
case grap.niveau when 2 Then p.identifiantuniversel + ' - ' + Isnull(pm.SIREN,'(pas de siren)') + ' - ' + pm.raisonsociale else '' end as col3,
pm.SIREN
from GetGrappageParLien531(25) grap
join t_personne p on grap.Pers_filiale = p.idpersonne
join t_personne_morale pm on pm.idpersonne = p.idpersonne

2 个答案:

答案 0 :(得分:2)

删除Notification.Name.前缀:

NotificationCenter.default.addObserver(self, selector: #selector(ImageScrollView.changeOrientationNotification), name: UIDevice.orientationDidChangeNotification, object: nil)

通知名称的常量已在Xcode 10随附的iOS 12 SDK中进行了移动。

答案 1 :(得分:1)

2020年4月9日,我遇到了类似的问题。我有:

name: Notification.Name.UIKeyboardWillHide

我不得不“用'UIResponder.keyboardWillHideNotification'替换'UIKeyboardWillHide'” 我单击“修复”并得到:

name: Notification.Name.UIResponder.keyboardWillHideNotification,

此后,我得到“类型'Notification.Name'(aka'NSNotification.Name')没有成员'UIResponder'”。最后,感谢你们,我弄清楚了:

name: UIResponder.keyboardFrameEndUserInfoKey.

也许我的情况和答案也会对一些初学者有所帮助))