Argument of '#selector' refers to instance method 'changeScale(byReactingTo:)' that is not exposed t
来源:互联网 发布:php bool false true 编辑:程序博客网 时间:2024/06/06 01:01
swfit 4 的新特性,
今天编译代码发现了这个问题,查了下,修正很简单在相关类前加:
@objcMembers!
As of Swift 4 you'll start seeing the error "Argument of '#selector' refers to instance method 'firstPage()' that is not exposed to Objective-C", along with the proposed fix of "Add '@objc' to expose this instance method to Objective-C". What this means is that the Swift method in question isn't visible to Objective-C, which matters because UIBarButtonItem
is Objective-C code.
While adding @objc
to individual methods is a working solution, I expect most people will just shrug their shoulders and put @objcMembers
before their class – that automatically exposes everything in the class to Objective-C, just like Swift 3 used to. So, modify the class definition to this:
- Argument of '#selector' refers to instance method 'changeScale(byReactingTo:)' that is not exposed t
- Swift 4.0 报错:Argument of '#selector' refers to instance method xxx
- object is not an instance of declaring class&argument type mismatch
- angular Argument of type '"price"' is not assignable to parameter of type 'string[]'
- 【Ionic】Argument of type“**Service”is not assignable to parameter of type 'RebirthHttp'.
- 奇怪的错误:This generally means that another instance of this process was already running or is hung in t
- profiler 报attach to a running instance of this jvm is not supported错误
- Quick And Easy Debugging Of Unrecognized Selector Sent To Instance
- 报错解决Argument 1 passed to model::get***() must be an instance of Entity_hotel, instance
- '#selector' does not refer to an '@objc' method,No method declared with Objective-C selector 'compos
- instance method '-setMasksToBounds:' not found (return type defaults to 'id')
- instance method '-methodName' not found (return type defaults to 'id')
- instance method '*****' not found (return type defaults to 'id')
- instance method '' not found (return type defaults to 'id')
- TypeError: argument of type 'int' is not iterable
- Bean property 'RegDao' is not writable or has an invalid setter method. Does the parameter type of t
- warning:Instance variable used while 'self' is not set to the result of '[(super or self) init…]'
- unrecognized selector sent to instance
- notepad++ c++版 插件开发入门
- 关于C语言操作符
- 201312-3 最大的矩形 ccf
- mybatis数据源
- jQuery选择器和选取方法
- Argument of '#selector' refers to instance method 'changeScale(byReactingTo:)' that is not exposed t
- HDU
- JDBC之连接池
- 面试汇总
- 算法第七周Delete Node in a BST[medium]
- NOIP初赛+CF某比赛 回忆录
- 用Sublime Text直接运行php文件
- Python爬虫——豆瓣电影Top250
- java基础知识--一些重要的关键字