Skip to content

Crash in -[MOMPrinter printPath:] #2

@jdv85

Description

@jdv85

Great tool! I get a crash when I run it on my xcdatamodel, though. The stack trace is below. I am on 10.9.

The problem is that [model configuration] contains NSStrings, but nameCmptr assumes NSEntityDescriptions.

I have fixed this locally by special casing nameCmptr by object class, but it is not very pretty. Do you want a pull request?

2013-10-31 10:42:47.365 XCDataModelPrinter[23092:507] -[__NSCFString name]: unrecognized selector sent to instance 0x7fd62ca244a0
2013-10-31 10:42:47.366 XCDataModelPrinter[23092:507] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString name]: unrecognized selector sent to instance 0x7fd62ca244a0'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff86d3e41c __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x00007fff87745e75 objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff86d412ed -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3   CoreFoundation                      0x00007fff86c9c5b2 ___forwarding___ + 1010
    4   CoreFoundation                      0x00007fff86c9c138 _CF_forwarding_prep_0 + 120
    5   XCDataModelPrinter                  0x000000010bc1d1b7 __24-[MOMPrinter printPath:]_block_invoke + 39
    6   CoreFoundation                      0x00007fff86c52829 __CFSimpleMergeSort + 169
    7   CoreFoundation                      0x00007fff86c5274b CFSortIndexes + 443
    8   CoreFoundation                      0x00007fff86c5d5de -[NSArray sortedArrayFromRange:options:usingComparator:] + 446
    9   XCDataModelPrinter                  0x000000010bc1cacb -[MOMPrinter printPath:] + 3131
    10  XCDataModelPrinter                  0x000000010bc1af26 main + 342
    11  XCDataModelPrinter                  0x000000010bc1adc4 start + 52
)
libc++abi.dylib: terminating with uncaught exception of type NSException
zsh: abort      XCDataModelPrinter Resources/SessionDocument.xcdatamodel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions