0

I created a data model as shown below:

enter image description here

Updated ArrayController entity name as : DownloadingFile, and performed related bindings:

a. ArrayController bindings

enter image description here

b. Table-column bindings

enter image description here

c. Add button bindings

enter image description here

I tapped on 'Add' button and it worked perfectly, as expected :)

Then I generated subclass of my managed object in swift, and suddenly it started crashing with below stack-trace printed in console:

2015-06-21 00:38:13.073 TableViewBindingsSample[2390:48630] Failed to create new object
2015-06-21 00:38:13.075 TableViewBindingsSample[2390:48630] (
    0   CoreFoundation                      0x00007fff838b703c __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x00007fff8687d76e objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff838b6e1a +[NSException raise:format:arguments:] + 106
    3   AppKit                              0x00007fff84fd34c9 _NSSendCommitEditingSelector + 267
    4   AppKit                              0x00007fff84fd35ab -[NSController _controllerEditor:didCommit:contextInfo:] + 185
    5   CoreFoundation                      0x00007fff8378e7bc __invoking___ + 140
    6   CoreFoundation                      0x00007fff8378e612 -[NSInvocation invoke] + 290
    7   CoreFoundation                      0x00007fff8382e5c6 -[NSInvocation invokeWithTarget:] + 54
    8   Foundation                          0x00007fff8812b41b __NSFireDelayedPerform + 364
    9   CoreFoundation                      0x00007fff8380a2e4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
    10  CoreFoundation                      0x00007fff83809f73 __CFRunLoopDoTimer + 1059
    11  CoreFoundation                      0x00007fff8387d53d __CFRunLoopDoTimers + 301
    12  CoreFoundation                      0x00007fff837c5608 __CFRunLoopRun + 2024
    13  CoreFoundation                      0x00007fff837c4bd8 CFRunLoopRunSpecific + 296
    14  HIToolbox                           0x00007fff8c3cf56f RunCurrentEventLoopInMode + 235
    15  HIToolbox                           0x00007fff8c3cf1ee ReceiveNextEventCommon + 179
    16  HIToolbox                           0x00007fff8c3cf12b _BlockUntilNextEventMatchingListInModeWithFilter + 71
    17  AppKit                              0x00007fff84c429bb _DPSNextEvent + 978
    18  AppKit                              0x00007fff84c41f68 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 346
    19  AppKit                              0x00007fff84c37bf3 -[NSApplication run] + 594
    20  AppKit                              0x00007fff84bb4354 NSApplicationMain + 1832
    21  TableViewBindingsSample             0x0000000100003c87 main + 87
    22  libdyld.dylib                       0x00007fff865225c9 start + 1
    23  ???                                 0x0000000000000003 0x0 + 3
)

So I tried to google it out and found a solution proposed by fellow developer: Failed to Create Object - Simple Core Data App but in my case the proposed solution is not working, in-fact I am unable to add project name as prefix to class name separated by dot, when I try to do so Xcode automatically removes added dot :(

Any ideas?

Community
  • 1
  • 1
Devarshi
  • 16,440
  • 13
  • 72
  • 125

1 Answers1

1

I got it working by removing @objc(EntityName) from generated NSManagedObject subclasses.

Devarshi
  • 16,440
  • 13
  • 72
  • 125