2011-09-22 74 views
1

在coredata中,我有一個瞬態屬性使用有部分。瞬態特性代碼在這裏:CoreData:瞬態屬性和localizedCaseInsensitiveCompare

- (NSString *) firstLetter_transient { 
[self willAccessValueForKey:@"firstLetter_transient"]; 
NSString *initial = [[[self memberName] substringToIndex:1] uppercaseString]; 
[self didAccessValueForKey:@"firstLetter_transient"]; 

return initial; 
} 

當我申請這個,用葡萄牙語,我得到,例如「Á」有第一個字母。

問題編號1:如何將「Á」放入「A」部分?我有這樣的錯誤:

「的操作無法完成(可可錯誤134060.)」

問題上午十時正2:當涉及到數字,我怎麼能影響到號碼段命名「#」?現在,數字1創建一個部分「1」,依此類推。

感謝所有,

RL

回答

1

您應該使用UILocalizedIndexedCollat​​ion做整理和分類條目段。用於實現此目的的代碼位於問題NSFetchedResultsController v.s. UILocalizedIndexedCollation

UILocalizedIndexedCollat​​ion的構建目的是能夠基於每種語言對基於當前語言設置的單詞進行分類。 Á和à將放在A部分。

相關問題