【iOS】Swift3 报错:Value of type 'AppDelegate' has no member 'managedObjectContext',UIApplication has no
来源:互联网 发布:python 命令行输入 编辑:程序博客网 时间:2024/04/28 12:40
Swift3 报错:Value of type ‘AppDelegate’ has no member ‘managedObjectContext’,UIApplication has no member ‘sharedApplication’
在Swift 3里面,需要通过viewContext访问managedObjectContext,且sharedApplication方法改为shared方法:
var context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext
以前是这样写的:
var context = (UIApplication.sharedApplication.delegate as AppDelegate).managedObjectContext
0 0
- 【iOS】Swift3 报错:Value of type 'AppDelegate' has no member 'managedObjectContext',UIApplication has no
- swift报错:value of type 'string' has no member 'generator'
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Has
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Has
- ubuntu-13.10安装vmware tools报struct dentry’ has no member named ‘d_count错,修正方法
- 'class QApplication' has no member named 'setMainWidget'
- truct in6_addr has no member named in6_u
- wireshark 报错 has no version symbol
- python报错:module has no Attribute'***'
- TypeError: object of type 'NoneType' has no len()
- TypeError: object of type 'zip' has no len()
- SMW0报错:For selected object type excel no application has been defined Maintain the settings
- TensorFlow1.0 运行报错 AttributeError: type object 'NewBase' has no attribute 'is_abstract'
- error: class " xxxxx " has no member of aaa; 二 error: identifier "aaa" is undefined
- mysql 创建函数报错:This function has none of DETERMINISTIC, NO SQL解决办法
- 关于Mysql创建函数报错This function has none of DETERMINISTIC, NO SQL, 的解决方案
- FORTRAN “Symbol has no implicit type"错误
- springmvc框架报错java.lang.IllegalArgumentException: No converter found for return value of type: class
- Linux下Redis 安装与简单配置
- 用R实现模糊匹配
- 中英文对照 —— 计算机、电路(电子)
- h.264 视频解码的一点小经验(ffmpeg)
- POJ 2559 - Largest Rectangle in a Histogram(单调栈)
- 【iOS】Swift3 报错:Value of type 'AppDelegate' has no member 'managedObjectContext',UIApplication has no
- 兼容ie8的rgba()方法
- DataNode启动优化改进:磁盘检测并行化
- 【转载】Android酷炫实用的开源框架(UI框架)
- 手机签到页面
- python3.5 beautiful4.4 扣扣国内新闻 爬虫
- Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.yyf.entity.Cus
- Java集合
- sdk+ndk+eclipse搭建android开发环境