I'm using CoreData to carry books information held in SQLite database. When sorting by title, I must disregard the "A" and "The" prefixes. For instance, when getting the books: "The Code Book" and "Fermat's Enigma", If only "Fermat's Enigma" in the future before "The Code Book" as "The" ought to be overlooked.

I could not find any method of doing that besides adding a persistent property which will contain the title without prefixes. (Within the example above, that property say 'titleNoPrefixes' should hold "Code Book" string). Sorting according to calculated qualities (also known as, transient qualities) appears to become impossible in CoreData.

Adding a persistent rentals are clearly a poor database design however i can't see one other way. Any suggestions?

You are able to write your personal NSString category that implements:

  1. Developing a copy of the NSString with articles removed (presuming you need to keep your original string)
  2. Evaluating strings came back from #1.


Your condition has next to nothing related to Core Data like a persistent store, this can be a general database sorting on text problem. The standard means to fix your condition is to possess a normal form area that's used because the sort category. You might like to lower situation everything and strip your noise words with this area. As these are merely game titles, this is not particularly costly, storage smart. In addition, it is really an place time operation as opposed to a search time op. Finally, transient variables only appear in RAM. They're NULL values, In my opinion, within the datastore. Hence, looking for them is pointless and throws the best.