Closed ohdonpiano closed 11 years ago
In addition, a sample code from my project:
NSFNanoSearch *search = [NSFNanoSearch searchWithStore:nanoStore];
NSFNanoSortDescriptor *sortByDate = [[NSFNanoSortDescriptor alloc] initWithAttribute:@"date" ascending:NO]; search.sort = [NSArray arrayWithObject:sortByDate]; search.limit = 10; search.offset = 0;
search.filterClass = @"Profile";
NSError *error = nil; result = [search searchObjectsWithReturnType:NSFReturnObjects error:&error];
Thanks Daniele!
Many thanks to you for the project and the quick fix !!!
Hi,
I've recently found out that if "limit" and "filterClass" are used within the same PPNanoSearch basic query, to achieve a limited set of PPNanoObjects of particular class type, the filterClass is not used.
Reporting the queries below:
With filterClass, without limit:
SELECT NSFKey, NSFKeyedArchive, NSFObjectClass FROM NSFKeys WHERE NSFObjectClass = "Profile"
With filterClass and limit:
SELECT NSFKey, NSFKeyedArchive, NSFObjectClass FROM NSFKeys LIMIT 10
loosing the WHERE clause, the query does return objects of any kind.