【发布时间】:2014-12-21 19:31:15
【问题描述】:
我刚刚尝试创建一个简单的核心数据应用程序,但出现了错误。我正在使用 Xcode 6.1 和 swift。我之前已经快速完成了这项工作并且没有任何问题,所以我对我错过或忘记的内容感到困惑。我在 GitHub 上有项目here
错误代码在底部。在查看 Apple 的文档 here 时,Apple 表示:
原因:在您的托管对象模型中,您可能已经为实体指定了一个自定义类,但您还没有实现该类。
解决方法:实现自定义类,或者指定实体由 NSManagedObject 表示。
我已将模型中的子类添加到项目中。
任何人都有这个问题,可以指出正确的方向吗?
2014-12-21 14:20:25.983 CoreDataNoStoryBoard[72437:7539866] Failed to create new object
2014-12-21 14:20:25.984 CoreDataNoStoryBoard[72437:7539866] (
0 CoreFoundation 0x00007fff9270c64c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff8bb356de objc_exception_throw + 43
2 CoreFoundation 0x00007fff9270c42a +[NSException raise:format:arguments:] + 106
3 AppKit 0x00007fff98329507 _NSSendCommitEditingSelector + 267
4 AppKit 0x00007fff97fcd2bf -[NSController _controllerEditor:didCommit:contextInfo:] + 185
5 CoreFoundation 0x00007fff925e533c __invoking___ + 140
6 CoreFoundation 0x00007fff925e5192 -[NSInvocation invoke] + 290
7 CoreFoundation 0x00007fff92683e56 -[NSInvocation invokeWithTarget:] + 54
8 Foundation 0x00007fff9399eabb __NSFireDelayedPerform + 364
9 CoreFoundation 0x00007fff9265fb44 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
10 CoreFoundation 0x00007fff9265f7d3 __CFRunLoopDoTimer + 1059
11 CoreFoundation 0x00007fff926d2d9d __CFRunLoopDoTimers + 301
12 CoreFoundation 0x00007fff9261c268 __CFRunLoopRun + 2024
13 CoreFoundation 0x00007fff9261b838 CFRunLoopRunSpecific + 296
14 HIToolbox 0x00007fff8cc3643f RunCurrentEventLoopInMode + 235
15 HIToolbox 0x00007fff8cc360be ReceiveNextEventCommon + 179
16 HIToolbox 0x00007fff8cc35ffb _BlockUntilNextEventMatchingListInModeWithFilter + 71
17 AppKit 0x00007fff97bd86d1 _DPSNextEvent + 964
18 AppKit 0x00007fff97bd7e80 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 194
19 AppKit 0x00007fff97bcbe23 -[NSApplication run] + 594
20 AppKit 0x00007fff97bb72d4 NSApplicationMain + 1832
21 CoreDataNoStoryBoard 0x00000001000059b2 top_level_code + 34
22 CoreDataNoStoryBoard 0x00000001000059ea main + 42
23 libdyld.dylib 0x00007fff97a805c9 start + 1
24 ??? 0x0000000000000003 0x0 + 3
)
【问题讨论】:
-
请在问题本身中包含相关代码(发生错误的地方)。