iOS开发bug消灭之:Generic parameter 'ResultType' could not be inferred

错误:Generic parameter ‘ResultType’ could not be inferred
swift版本:3.0
Xcode版本:8.0
错误原因:声明NSFetchRequest类型的时候没能指定其类型
错误源码:

        let fetchRequest:NSFetchRequest = NSFetchRequest(entityName: "Person")

修正源码:

        let fetchRequest:NSFetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: "Person")

简洁版:

        let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: "Person")

参考:

https://forums.developer.apple.com/thread/49162

阅读更多
版权声明:本文为博主原创文章,转载请注明出处。 https://blog.csdn.net/tsyccnh/article/details/52722893
文章标签: ios xcode swift
个人分类: iOSbug消灭纪实
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭