swift学习记录(selector)
来源:互联网 发布:淘宝韩束旗舰店 编辑:程序博客网 时间:2024/06/11 07:47
转载自:http://stackoverflow.com/questions/24007650/selector-in-swift
https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithObjective-CAPIs.html#//apple_ref/doc/uid/TP40014216-CH4-XID_26
原文:An Objective-C selector is a type that refers to the name of an Objective-C method. In Swift, Objective-C selectors are represented by the Selector
structure. You can construct a selector with a string literal, such as let mySelector: Selector = "tappedButton:"
. Because string literals can be automatically converted to selectors, you can pass a string literal to any method that accepts a selector.
翻译:在Objective-C 中 selector是指向方法名的类型,在swift中Selector由结构构造,你可以直接用字符串构造一个Selector,例如:let mySelector = "tappedButton",因为字符串可以自动转化成selectors,你可以直接输入方法名的字符串,来适配一个selector。
原文:NOTE
The performSelector:
method and related selector-invoking methods are not imported in Swift because they are inherently unsafe.
翻译:注意:
performSelector方法和设计selector的方法并没有在Swift中被引入,因为他们是不安全(固有的)的。
- swift学习记录(selector)
- Android selector(背景选择器)学习记录
- swift学习记录(开端)
- swift学习记录(Optional)
- swift学习记录(switch)
- swift学习记录(for)
- swift学习记录(func)
- 操作 swift学习记录(-)
- swift学习记录(in)
- swift 学习记录(一)
- swift 学习记录(二)
- swift 学习记录(三)
- swift 学习记录(四)
- swift学习记录(String)
- swift学习记录(函数)
- swift学习记录(枚举)
- swift 学习记录(继承)
- swift学习记录(析构器)
- hibernate 数据库方言
- 在具有 HMC 的情况下通过使用介质设备安装分区来安装 AIX
- TNet Tasharen Networking 插件使用
- z-stack中的波特率设置在哪个文件夹下?
- hdu 1281 棋盘游戏 (最大匹配,重要点)
- swift学习记录(selector)
- http://blog.itpub.net/29876893/list/1/
- 多线程断点下载
- Veins中实现Nakagami-m信道模型(一种简单的方法)
- ARP攻击和DOS攻击
- 2.下载Spark并尝试使用
- swing实现计算器
- 关于缓冲区到函数返回地址分析
- SPOJ - QTREE (树链剖分)