rentzsch/mogenerator — Issue #92: Wrong handling of variable expressions
Author: ChristianKienle
Created: 2012-02-18 10:04:18+00:00
State: open

The current version of mogenerator (1.24) does not handle variable expressions in fetch requests correctly.

Description & steps in order to reproduce the issue:

1. Download the sample model from http://dl.dropbox.com/u/29925418/mogeneratorissue.xcdatamodel.zip
2. The model contains three entities and a few relationships:

World ---- countries ---->> Country ---- cities ---->> City

The entity "City" has an attribute named "testAttribute". In addition the model also contains a fetch request with a variable expression:

Fetch all "World" objects where:
Expression: countries.cities.testAttribute == $testExpression

3. Run mogenerator on the model. mogenerator should crash.

Observations:

I have tried down to track down the issue myself - here is what I found out: The method
```
- (void)_processPredicate:(NSPredicate*)predicate_ bindings:(NSMutableArray*)bindings_
```
contains the code that handles a single predicate. This method calls _resolveKeyPathType where the crash occurs.