Блочная версия для iOS 4.0:
__block int sum = 0;
NSString *string = [NSString stringWithString:@"abcdefghijklmnopqrstuvwxyz"];
[string enumerateSubstringsInRange:NSMakeRange(0,[string length])
options:NSStringEnumerationByComposedCharacterSequences
usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) {
// 'a'=97=0x61=01100001, 'A'=65=0x41=01000001
// 26 letters and 2^5-1=31 so only 5 lower bits needed
sum += [substring characterAtIndex:0] & 0x1F;
// which is the same as
// sum += [substring characterAtIndex:0] -'a'+1;
}];