Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8311179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:43:33+00:00 2026-06-08T19:43:33+00:00

How to Traversal emojis in NSString There is a NSString method used to traversal

  • 0

How to Traversal emojis in NSString
There is a NSString method used to traversal substring of NSString

    NSString *text = @"2012我们 ";
    [text enumerateSubstringsInRange:NSMakeRange(0, [text length]) options:NSStringEnumerationByComposedCharacterSequences  usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) {
    printf("%s- ",[substring UTF8String]);
}];

Guess what is the output?

The output is :

    2- 0- 1- 2- - 我- 们-  - - - - - - - - - - - -  - - 

Rather than:

   2- 0- 1- 2- - 我- 们-  - - - - - - - - - - 

Like the American Flag , it’s composed by and
The length of a flag seems to be 4, and they are composed by two length-2-composed-character.
while the NSString is enumerated , it gives me and rather than

When the string is in UITextView, the BACKSPACE in Keyboard is tapped, it can handle to delete the emoji rather than .

In my app, I made a custom emoji keyboard and there is a DELETE button. I want to the DELETE button works just like the system BACKSPACE button in keyboard.

Does anyone know how to handle it ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T19:43:35+00:00Added an answer on June 8, 2026 at 7:43 pm

    I’m not a unicode expert, but I believe the problem here is that the flags are actually two characters. They’re regional indicator symbols. The american flag, for example, is two distinct characters: REGIONAL INDICATOR SYMBOL LETTER U and REGIONAL INDICATOR SYMBOL LETTER S.

    http://en.wikipedia.org/wiki/Regional_Indicator_Symbol

    You might have luck asking the text input system to do the tokenization for you, as it seems to understand (when deleting, for example) that they should be treated as one unit. Try using the UITextInputTokenizer method positionFromPosition:toBoundary:inDirection: to move from the end of the string to the previous character (ie pass UITextGranularityCharacter). You can get a tokenizer from a UITextView or UITextArea’s tokenizer method.

    Hope that helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm curious what the best method is for managing the traversal through several views
Is there a way to execute commands using directory traversal attacks? For instance, I
I'm wondering if its possible to have an inorder tree traversal method in java
Tree traversal refers to the process of visiting each node in a tree data
I'm using nested sets (aka modified preorder tree traversal) to store a list of
I'm using WWW::Mechanize to do some standard website traversal, but at one point I
Anyone has a ready implementation of the Reverse Breadth First traversal algorithm in C#?
I have this code for BinaryTree creation and traversal class Node { Integer data;
Which data structure is most suitable for forward and backward webpage traversal in web
I have created a concurrent, recursive directory traversal and file processing program, which sometimes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.