zoukankan      html  css  js  c++  java
  • xcode 7种使用coredata遇到 Class not found, using default NSManagedObject instead.问题

    CoreData: warning: Unable to load class named 'CoreDataSwift2_2.Bowtie' for entity 'Bowtie'.  Class not found, using default NSManagedObject instead.
    
    fatal error: NSArray element failed to match the Swift Array Element type

    xcode 7 中遇到这种问题纠结了好久,最终解决了。

    This warning is quite annoying. It appears spuriously. I have been able to get rid of it in most cases by making sure that the class is set correctly in the model editor. Unlike in many other SOF posts, the suggestion to include the module name (like MyApp.Shows) has not helped me.

    1.
    Version that works up to Xcode 7 beta 3

    Up to XCode7 b3

    Notice that I corrected your entity name to the more appropriate singular.

    Version that works for Xcode 7 beta 4 and above

    You need to delete the text "Current Product Module" in Module!

    From Xcode7 beta 3

    2.
    You should also follow the frequent recommendation to include

    @objc(Show)
    

    just above your class.

    Note: If you are using Xcode 7 beta 4 or later, this step is optional.

    3.
    Also make sure to cast the created managed object to the proper class, as the default would be just NSManagedObject.

    var newShow = NSEntityDescription.insertNewObjectForEntityForName("Show", 
                     inManagedObjectContext: context) as Show
    
  • 相关阅读:
    Charles手机端抓包--证书
    新浪微盘批量下载
    [3140] Sublime Text 2.x, 3.x 通用注册码、密钥集合
    栈的数组实现
    栈的链表实现
    基数排序
    多项式相乘-数组实现
    最大子序列和问题的四种算法
    链表的实现
    时间同步算法与Simple Ring-based election algorithm算法分析-转载
  • 原文地址:https://www.cnblogs.com/xmandxx/p/4936592.html
Copyright © 2011-2022 走看看