• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
localized compare and SQLite persistent store
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: localized compare and SQLite persistent store
      • From: Melissa Turner <email@hidden>
  • Prev by Date: Re: Core Data SQL store looses data that XML store does not
  • Next by Date: Types for the method have to conform?
  • Previous by thread: Re: NSUserDefaults and thread safety
  • Next by thread: Re: localized compare and SQLite persistent store
  • Index(es):
    • Date
    • Thread