iOS 8.3: Allow Core Data predicate of "ALL manyRelateds == nil"

Originator:pcgoracke
Number:rdar://20926315 Date Originated:12-May-2015 03:41 PM
Status:Open Resolved:
Product:iOS Product Version:8.3 (12F69)
Classification:Feature (New) Reproducible:Always
 
Summary:
While investigating the issue that is now filed as rdar:20924980, I tried creating a fetch request whose predicate was "ALL manyRelateds == nil" in an attempt to find all instances of an entity without any objects related via the manyRelateds property.

Steps to Reproduce:
A sample project is attached which demonstrates this if you select the 3rd cell labeled, "Unattached As via ALL (crash)"

STR separately:
1. Create a Core Data model with A<<->>B many-to-many related entities, whose relationships are A.manyBs and B.manyAs.
2. Create a fetch request for entity A whose predicate is "ALL manyBs == nil".
3. Attempt to execute the fetch request.

Expected Results:
This would be translated into a SQL query which could retrieve all A entities without any related B objects.

Actual Results:
'NSInvalidArgumentException' is thrown, reason: 'Unsupported predicate ALL manyRelateds == nil'

Version:
Xcode 6.3.1 (6D1002), iOS 8.3 (12F69)

Notes:
Workaround: Using an inverted predicate of "NONE manyBs != nil" works, but arriving at it as non-intuitive. "ALL manyBs == nil" seems to be the logical way one would express this, but I am not allowed to.

Configuration:
Any, Simulator or iOS device.

Attachments:
'ManyAToManyB.zip' was successfully uploaded.
(project at <https://github.com/pgor/ManyAToManyB>)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!