gpt4 book ai didi

ios - "Class not found, using default NSManagedObject"AppName 中有特殊字符

转载 作者:行者123 更新时间:2023-11-29 02:11:22 28 4
gpt4 key购买 nike

当我在 App-Name 中使用“-”字符时,出现以下错误:

CoreData: warning: Unable to load class named "<AppName>.<ClassName>" for entity <ClasName>. Class not found, using default NSManagedObject instead.

我将 CoreData 与子类 NSManagedObjects 一起使用,因此我将 DB 文件中的所有实体类名称命名为 AppName.ClassName。

App-Names 中是否禁止使用此字符?

谢谢!

最佳答案

我不确定这是否适用于 NSManagedObjects,但 Apple 书籍“Using Swift with Cocoa and Objective C”(在“Mix and Match”标题下,指出:

Naming Your Product Module

The name of the Xcode-generated header for Swift code, and the name of the Objective-C bridging header that Xcode creates for you, are generated from your product module name. By default, your product module name is the same as your product name. However, if your product name has any non-alphanumeric characters, such as a period (.), they are replaced with an underscore (_) in your product module name. If the name begins with a number, the first number is replaced with an underscore.”

Excerpt From: Apple Inc. “Using Swift with Cocoa and Objective-C.” Apple Inc., 2014-07-31T07:00:00Z. iBooks. This material may be protected by copyright.

Check out this book on the iBooks Store: https://itun.es/gb/1u3-0.l

这显然是为了桥接 header ,但我只是想知道类似的规则是否适用于 CoreData 类名。

关于ios - "Class not found, using default NSManagedObject"AppName 中有特殊字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29251375/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com