Search code examples
core-dataxcode4.5

Fetching names from core data and converting it to upper case


NSPredicate *predicate = [NSPredicate predicateWithFormat: @"salesRepName == %@",salesName]; [request setPredicate:predicate]; This is my fetching. Is it possible to fetch the name from table and directly converting to UPPER CASE without using a string?


Solution

  • No, that is not possible. The only way (as far as I know) to fetch computed results in a Core Data fetch request is using NSExpressionDescription with [NSExpression expressionForFunction:…], and that does not support the uppercaseString function. So you have to convert the values to uppercase after fetching them.