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

  • SEARCH
  • Home
  • 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 9275257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:32:43+00:00 2026-06-18T16:32:43+00:00

My app creates and stores EKEvents into the standard Calendar database, however, I’ve found

  • 0

My app creates and stores EKEvents into the standard Calendar database, however, I’ve found that if I use an emoticon as the “notes” for an event, it causes a crash when trying to read the event out of the Calendar.

I don’t want or need the use of emoticons in the event.notes. I just happened to be testing and was kind of shocked when it let me save the event. (The emoticons even show up in the Calendar itself)

So I think my problem can be solved one of 2 way, neither of which I’ve been able to figure out.

1) Can I disable or hide the custom keyboard button? <–I’d prefer this solution

enter image description here

2) If not, how do I create a character set that includes all of the possible characters in all of the standard keyboards to check against when making sure the user does not type an emoticon?

I’ve tried using some of the standard character sets to check against, like alphanumericCharacterSet, but using that, I can’t type in spaces.

Here’s the code I’m using so far, to check against the character the user is typing:

- (BOOL)textField:(UITextField *)theTextField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
    if (string.length == 0) {
        return YES;
    }

    NSCharacterSet *myCharSet = [NSCharacterSet alphanumericCharacterSet];
    for (int i = 0; i < [string length]; i++) {
        unichar c = [string characterAtIndex:i];
        if ([myCharSet characterIsMember:c]) {
            return YES;
        }
    }

    UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"Invalid Input" message:@"Oops! You can't use that character." delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil];
    [av show];
    return NO;
}

EDIT: Clarification on the error

There is no error, only a crash.
My app saves calendar events, and displays them in a list to the user.
The user can then mark the event as “Paid” or “Unpaid” at which time I append a string to the .notes property of the event ” – Paid”. This is so when I reload the table, if the event is paid, it displays a specific icon to the user.
The crash happens when the saved even has an emoticon as the .notes property, and I try to append the .notes.

  • 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-18T16:32:44+00:00Added an answer on June 18, 2026 at 4:32 pm

    You can combine NSCharacterSets using a union to add more allowable characters:

        NSMutableCharacterSet *myCharSet = [[NSCharacterSet alphanumericCharacterSet] mutableCopy];
        [myCharSet formUnionWithCharacterSet:[NSCharacterSet whitespaceAndNewlineCharacterSet];
    

    Here is the list of available character sets to choose from:

    controlCharacterSet
    whitespaceCharacterSet
    whitespaceAndNewlineCharacterSet
    decimalDigitCharacterSet
    letterCharacterSet
    lowercaseLetterCharacterSet
    uppercaseLetterCharacterSet
    nonBaseCharacterSet
    alphanumericCharacterSet
    decomposableCharacterSet
    illegalCharacterSet
    punctuationCharacterSet
    capitalizedLetterCharacterSet
    symbolCharacterSet
    newlineCharacterSet
    

    Also, your code is checking to make sure any character is not outside the set; I think your intention is to check that all characters are not outside the set. (This only applies when the user enters more than one character at once – think copy and paste).

    Consider adjusting your loop to look more like this:

    NSCharacterSet *myCharSet = [NSCharacterSet alphanumericCharacterSet];
    for (int i = 0; i < [string length]; i++) {
        unichar c = [string characterAtIndex:i];
        if ([myCharSet characterIsMember:c] == NO) {
            // add your user alert here
            return NO;
        }
    }
    

    This way your loop won’t simply exit on the first good character it finds; instead, it will exit on the first bad character.

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

Sidebar

Related Questions

I have an app that creates and stores a session with a given start
I have a rest app with resteasy, which creates files and stores them and
I have an app that creates a variable number of ScatterviewItems based on which
I am developing an app right now which creates and stores a connection to
I have a C# app that creates a settings file for itself to store
We have an ASP.NET MVC app that sits on top of a Drupal database
Please Help.... Ive created and App for Android 2.2 that creates a text file
I have an app with a pre-filled .sqlite file that is copied into the
We have an app that creates queues and services in SQL Server using the
I'm working on an iOS app that creates location sets where each row contains

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.