NSString length with flag emojis
问题 I'm trying to get the length of an NSString that contains a bunch of emojis, including the flag characters. Now I know how to get the length of a string containing emojis: __block NSInteger length = 0; [string enumerateSubstringsInRange:range options:NSStringEnumerationByComposedCharacterSequences usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) { length++; }]; However, "NSStringEnumerationByComposedCharacterSequences" doesn't work in this case.