Bruce Fancher wrote:
> A few months ago, after I saw that how the new EOModeler saves
> EOFetchSpecifications in property list files I posted a message to the list
> asking about converting EOFetchSpecifications and other objects to and from
> property list files. This would be generally useful for, among other
> things, saving objects to the database.
>
> Someone sent me some methods for EOFetchSpecification to do this, but I've
> only just gotten around to trying out they sent me and I'm having problems.
>
> Specifically, this code snippet:
>
> EOFetchSpecification *fetchSpecification =
> [EOFetchSpecification fetchSpecificationWithEntityName:@"IDUser"
> qualifier:qualifier
> sortOrderings:nil];
> NSLog (@"fetchSpecification: %@", fetchSpecification);
> [[fetchSpecification description] propertyList]
>
> Generates this output:
>
> Mar 20 22:34:50 TestFoo[403] fetchSpecification: {
> entityName = IDUser;
> fetchLimit = 0;
> hints = {};
> isDeep = YES;
> prefetchingRelationshipKeyPaths = nil;
> promptsAfterFetchLimit = NO;
> qualifier = (username = 'digital');
This is the problem... thats not legal
It looks like the Qualifier doesn't write its-self out in a format
that is PPL legal..
Looks like that should either be
{username = 'digital'}
or
({username='digital'})
or
("username = \'digital\'")
> rawRowKeyPaths = nil;
> requiresAllQualifierBindingVariables = NO;
> sortOrdering = nil;
> usesDistinct = NO;
> }
> Mar 20 22:34:50 TestFoo[403] *** Uncaught exception:
> <NSParseErrorException> *** Separator ')' expected;
> Parse error line 8 (position 190) for units: (xObject, Dictionary,
> parseDictionary, xObject, Array, parseArray);
> Next token is '='
> stack: 0x32040b0e 0x320411eb 0x3203b17f 0x4010c8 0x40129c 0x77f1b304
>
>
> If I grab that string and call propertyList on it, it does the same thing.
> However, if I remove the "qualifier = . . . " line from it, it works.
>
> Anyway, what's the right way to do this?
>
> Is there some private API EOF is using to encode and decode the FetchSpecs?
>
> Thanks.
>