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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:41:51+00:00 2026-06-16T15:41:51+00:00

I am making a form in objective-c. I post all the data that I

  • 0

I am making a form in objective-c. I post all the data that I filled in, in my form to a webservice. This gives me a 200-code if everything is OK and the data is posted successfully. But it gives me a 406-code if there is something wrong. If that is the case. The JSON also contains error objects. You can see an example of the JSON over here.

{

    "data": {
        "status": 406,
        "message": "Not Acceptable",
        "errors": {
            "cu_email": [
                "'stefappmax.be'is no valid email!"
            ]
        }
    }

}

Al my textfields have the same name as in the JSON e.g. My email-textfield calls cu_email
Now I have this piece of code.

   NSDictionary* dict = [json objectForKey:@"data"];
                NSLog(@"dict: %@",dict);
                for (NSString *errorObject in [dict objectForKey:@"errors"]) {
                    NSLog(@"error name: %@",errorObject);
                }

This gives back all the names of the textfields that contains an error. What I want to do now is to make a red border around those textfields. I know to place a border you need to implement the quartzcore frame work and add this piece of code.

self.cu_email.layer.borderColor = [[UIColor redColor] CGColor];

But do you guys now how I can replace the cu_email with the errorObject?

  • 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-16T15:41:52+00:00Added an answer on June 16, 2026 at 3:41 pm

    I think this will work for you:

    You can access that textField property using KVC:

    UITextField *theErrorField = (UITextField *)[self valueForKey:errorObject];
    theErrorField.layer.borderColor = [[UIColor redColor] CGColor];
    theErrorField.layer.borderWidth = 3.0;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright, so I'm making a form validation everything is good in this JS, but
I've been making this login form in C# and I wanted to 'submit' all
Making a form that will accept a bunch of textual data and an image
Can anyone tell me whats wrong with this code, im validating a form making
I was making a form that is um... quite large and all inputs consist
I'm making a form that requires at least one field to be filled AND
I am making a form that builds itself from a given db and table.
I'm making a simple form that is to step through a program iteratively. How
I am making form in CakePHP I want the HTML for that form as
i am making a form that has a date field using textfield, i want

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.