yepher / CoreDataUtility

An OSX application that simplifies development and debugging of CoreData enabled applications.
519 stars 49 forks source link

Exception when filtering data of entity which contains transformable attribute #14

Closed delebedev closed 11 years ago

delebedev commented 11 years ago

Here it the trace (1800 is 'NSTransformableAttributeType'):

2013-03-09 19:05:49.984 CoreDataPro[7015:303] NSPredicatePattern cannot create operators for an NSAttributeDescription with type 1800 2013-03-09 19:05:49.986 CoreDataPro 7015:303 ( 0 CoreFoundation 0x00007fff86dd60a6 __exceptionPreprocess + 198 1 libobjc.A.dylib 0x00007fff902a93f0 objc_exception_throw + 43 2 CoreFoundation 0x00007fff86dd5e7c +[NSException raise:format:] + 204 3 AppKit 0x00007fff8a373708 +[NSPredicateEditorRowTemplate _operatorsForAttributeType:] + 474 4 AppKit 0x00007fff8a373a1b +[NSPredicateEditorRowTemplate templatesWithAttributeKeyPaths:inEntityDescription:] + 478 5 CoreDataPro 0x0000000100023440 -[MFLMainWindowController showPredicateEditor:] + 1840 6 AppKit 0x00007fff89dd9a59 -[NSApplication sendAction:to:from:] + 342 7 AppKit 0x00007fff89dd98b7 -[NSControl sendAction:to:] + 85 8 AppKit 0x00007fff89dd97eb -[NSCell _sendActionFrom:] + 138 9 AppKit 0x00007fff89dd7cd3 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 1855 10 AppKit 0x00007fff89dd7521 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 504 11 AppKit 0x00007fff89dd6c9c -[NSControl mouseDown:] + 820 12 AppKit 0x00007fff89dce60e -[NSWindow sendEvent:] + 6853 13 AppKit 0x00007fff89dca744 -[NSApplication sendEvent:] + 5761 14 AppKit 0x00007fff89ce02fa -[NSApplication run] + 636 15 AppKit 0x00007fff89c84cb6 NSApplicationMain + 869 16 CoreDataPro 0x0000000100001302 main + 34 17 CoreDataPro 0x00000001000012d4 start + 52 )

yepher commented 11 years ago

Do you have a sample .mom and persistence file that demonstrates this?

delebedev commented 11 years ago

It's reproducible in test file 'fetchRequest.mom': just try to filter AnotherEntity

yepher commented 11 years ago

Thanks, I was able to reproduce this. I will have a look at it.

yepher commented 11 years ago

Filter no longer crashes on entities that contains NSTransformableAttributeType.

@garnett can you please verify it is working for you. If so I will close the issue.

This is the commit that solves the issue and has been merged into Develop and Master. I will wait until verified before merging into feature/multiDocSupport.

Commit: 26da37af4a933667a27325432d180c89407a51ac [26da37a] Parents: da0782ef4a Date: March 13, 2013 8:15:37 AM CDT Prevents crash when attribute type NSTransformableAttributeType. This was reported in issue #14.

On a side note:

I don't really call this a fix. It is more of a solution to prevent the filter crash.

I would like to enable filtering for this type somehow but I am not sure what the best solution is. The attributeValueClassName will probably help with the filter scheme but I am not sure how folks tend to use this in their data models. If it is custom classes than maybe the best we can do is allow them to filter by size or less valuable "attributeValueClassName" which will probably be all the same.

For now I have just excluded "NSTransformableAttributeType" from the filter list until someone finds a need and can offer a good scenario for filtering by that attribute type.

delebedev commented 11 years ago

Works for me.