Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

localized compare and SQLite persistent store



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.