localized compare and SQLite persistent store
localized compare and SQLite persistent store
- Subject: localized compare and SQLite persistent store
- From: Clifford Crawford <email@hidden>
- Date: Wed, 10 Aug 2005 21:02:40 -0400
Hello,
I'm getting a weird problem involving NSSortDescriptor (using the
localizedCaseInsensitiveCompare: method) and SQLite. My app has a
table view which automatically sorts every time a new entry is added,
which I set up by binding the array controller's sortDescriptors to
the following method in my app delegate:
- (NSArray *)wordSortDescriptors {
if (!wordSortDescriptors) {
wordSortDescriptors = [NSArray arrayWithObjects:
[[NSSortDescriptor alloc] initWithKey:@"word" ascending:YES
selector:@selector
(localizedCaseInsensitiveCompare:)],
[[NSSortDescriptor alloc] initWithKey:@"gloss"
ascending:YES
selector:@selector
(localizedCaseInsensitiveCompare:)],
nil];
}
return wordSortDescriptors;
}
When I use an XML-based persistent store, this works fine; however,
when I switched to using SQLite, I get the following error on app
startup:
NSRunLoop ignoring exception 'unsupported NSSortDescriptor selector:
localizedCaseInsensitiveCompare:' that raised during posting of
delayed perform with target
3e5f70 and selector 'invokeWithTarget:'
and none of the data displays in the table view. If I comment out
the "selector:..." parts in the wordSortDescriptors method above,
however, then the app *does* work using SQLite, but now the entries
in the table view aren't sorted properly (all of the entries contain
Japanese text, so I need to use localized compare). Does anyone know
what I'm doing wrong here? Why would the type of persistent store
I'm using affect whether or not I can call the
localizedCaseInsensitiveCompare: method??
Thanks, Cliff
--
Cliff Crawford *** email@hidden
"The perfection of art is to conceal art." -- Quintilian
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden