iphone - Issue with fetching core data objects using NSPredicate -


before start let me give how data model looks like:

enter image description here

i have fetch request following predicate:

nsarray *allowedpacknames = @[@"success, happiness, free"];             self.fetchedresultscontroller = [author mr_fetchallgroupedby:nil                                                            withpredicate:[nspredicate predicatewithformat:@"any quotes.quote.pack.packname in %@", allowedpacknames]                                                                 sortedby:authorkeys.name                                                                ascending:yes                                                                 delegate:self]; 

i wanted fetch authors has quote packname of success or happiness or free. author has nsset of quotes can see in relationship table below. when execute following error:

coredata: error: (1) i/o error database @ /users/abdul/library/application support/iphone simulator/6.1/applications/da17421b-a54d-42e3-9694-fdcbff7f8ba4/library/application support/mycoolapp/mycoolapp.sqlite.  sqlite error code:1, 'no such column: t2.zquote' 2013-04-05 15:26:47.175 mycoolapp[78622:c07] core data: annotation: -executerequest: encountered exception = i/o error database @ /users/aditya/library/application support/iphone simulator/6.1/applications/da17421b-a54d-42e3-9694-fdcbff7f8ba4/library/application support/mycoolapp/mycoolapp.sqlite.  sqlite error code:1, 'no such column: t2.zquote' userinfo = {     nsfilepath = "/users/abdul/library/application support/iphone simulator/6.1/applications/da17421b-a54d-42e3-9694-fdcbff7f8ba4/library/application support/mycoolapp/mycoolapp.sqlite";     nssqliteerrordomain = 1; } 

any idea why?

if see correctly, predicate should be

[nspredicate predicatewithformat:@"any quotes.pack.packname in %@", allowedpacknames] 

i.e. have remove "quote", attribute of quote entity, not relationship.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -