我刚刚用Swift创建了一个新类,叫做myViewController,是UIViewController.
myViewController
UIViewController
import UIKit class myViewController: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource { ... }
上面说在UIPickerViewDataSource上有Type "myViewController" does not conform to protocol UIPIckerDataSource个.
Type "myViewController" does not conform to protocol UIPIckerDataSource
Is it a bug of Xcode-Beta 3??
如果你想遵守这些协议,你需要实现UIPickerViewDataSource和UIPickerViewDelegate中所有必需的方法.
UIPickerViewDataSource
UIPickerViewDelegate
Swift is more like java when it comes to protocols因为如果不实现协议声明的所有必需方法,将得到编译时错误,而不是运行时异常.
Java核心技术面试精讲 -〔杨晓峰〕
微服务架构实战160讲 -〔杨波〕
深入剖析Kubernetes -〔张磊〕
代码精进之路 -〔范学雷〕
安全攻防技能30讲 -〔何为舟〕
人人都能学会的编程入门课 -〔胡光〕
实用密码学 -〔范学雷〕
深入浅出分布式技术原理 -〔陈现麟〕
徐昊 · TDD项目实战70讲 -〔徐昊〕
Kubernetes入门实战课 -〔罗剑锋〕
零基础学Python(2023版) -〔尹会生〕
运维监控系统实战笔记 -〔秦晓辉〕
无涯教程 - TensorFlow教程
无涯教程 - PHP7+教程
无涯教程 - DBUtils教程
无涯教程 - MariaDB教程
无涯教程 - RSpec教程
无涯教程 - Go Web 爬虫指南教程
无涯教程 - Python 区块链开发实用指南教程
无涯教程 - MySQL8 秘籍教程