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 9168513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:38:35+00:00 2026-06-17T15:38:35+00:00

This is what I got Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘Can’t

  • 0

This is what I got

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Can't do regex matching on object <UITextField: 0x7165730; frame = (121 208; 179 30); text = 'mail@test.com'; clipsToBounds = YES; opaque = NO; autoresize = RM+BM; gestureRecognizers = <NSArray: 0x7166ca0>; layer = <CALayer: 0x715ed50>>.'
*** First throw call stack:
(0x1c94012 0x10d1e7e 0xbfbb5e 0xb38bae 0xb383dc 0xb37e9a 0x3c04 0x29a9 0x10e5705 0x1c920       0x1c8b8 0xdd671 0xddbcf 0xdcd38 0x4c33f 0x4c552 0x2a3aa 0x1bcf8 0x1befdf9 0x1befad0 0x1c09bf5 0x1c09962 0x1c3abb6 0x1c39f44 0x1c39e1b 0x1bee7e3 0x1bee668 0x1965c 0x1f95 0x1e95)
libc++abi.dylib: terminate called throwing an exception

Sorry if too big, but I don’t understand that error, I disabled from .xib Autolayout because that made my App crash in old devices, and my app never crashed in that TextField, is the textfield for emails.

Thanks in advance.

EDIT:

My Code:

NSString *mail = [email.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
if ([self validarEmail:mail])
{
   // code
}

-(BOOL) validarEmail:(NSString *) mail // From internet made for objective-c
{
BOOL stricterFilter = YES;
NSString *stricterFilterString = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}";
NSString *laxString = @".+@.+\\.[A-Za-z]{2}[A-Za-z]*";
NSString *emailRegex = stricterFilter ? stricterFilterString : laxString;
NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];
return [emailTest evaluateWithObject:email];
}

If I comment the IF the app will be ok, if not, will crash.

Thanks in advance

  • 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-17T15:38:36+00:00Added an answer on June 17, 2026 at 3:38 pm

    You’re attempting to test a regular expression on a UITextField object when I assume you meant to test it on it’s text property instead.

    Edit since OP edited Question

    Notice this line:

    return [emailTest evaluateWithObject:email];
    

    Your ’email’ object is your text field, not your string. Your string is called mail (it’s passed into the method as a parameter.

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

Sidebar

Related Questions

I got an error like this - Terminating app due to uncaught exception 'NSInvalidArgumentException',
i've got this error after parsing. * Terminating app due to uncaught exception 'NSInvalidArgumentException',
I got this message when running the app: Terminating app due to uncaught exception
2012-09-07 19:31:07.938 BadgerNew[2590:707] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not
I've got the following error: 2012-04-18 10:15:49.585 FoodXJournal[13931:fb03] *** Terminating app due to uncaught
When i run my app, it crashes and i got this error: Terminating app
I´ve got this on the parent object @OneToMany(mappedBy=idUser, cascade = CascadeType.MERGE) public List<Directions> directions;
I am still new in objective-c programming, I got this exception, but I don't
I got the following error when deleting an object from my app. Any ideas
I got this weird crash in my app, when i try to call this

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.