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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:27:37+00:00 2026-05-17T01:27:37+00:00

I have 4 UITextFields that I’m dynamically creating, in the viewDidLoad, which works good.

  • 0

I have 4 UITextFields that I’m dynamically creating, in the viewDidLoad, which works good. I want to reference those objects when the UISlider value changes. Right now I’m storing those objects in a NSMutableArray and accessing them like so from the sliderChanged method:

    NSInteger labelIndex = [newText intValue];
labelIndex--;

NSUInteger firstValue = (int)0;

NSMutableArray *holeArray = [pointsArray objectAtIndex:labelIndex];
UITextField *textField = [textFieldArray objectAtIndex:firstValue];
NSString *newLabel1Text = [[NSString alloc] initWithString:[[holeArray objectAtIndex:firstValue] stringValue]];

[textField setText: newLabel1Text];

[newLabel1Text release];

Everything is working good, but the program crashes on the setText: method. The last message I get from the program is: [UILabel drawTextInRect:] and then I get a EXC_BAD_ACCESS failure.

I want to be able to acces that dynamically created UITextField, but I must be going about it the wrong way.

Thanks!

  • 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-05-17T01:27:37+00:00Added an answer on May 17, 2026 at 1:27 am

    Uh, yea, you create a text field, but you aren’t displaying the field itself, just creating it.

    If you want to do what I think you want to do, I would just do if statements.

    ex.

    if (firstValue == 1)
    {
     fieldone.text = @"whatever";
    }
    else if (firstValue == 2)
    {
    fieldtwo.text = @"whatever";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Scenario: I have 4 UITextFields that only accept 1 character. Easy. Problem: After I
I have some simple UITextFields that bring up the Numberpad. I would like to
I have 6 UITextFields on my UIScrollView . Now, I can scroll by user
Have just started using Visual Studio Professional's built-in unit testing features, which as I
I'm aware that to preserve memory usage, UITableViewCells are reused when scrolling. I have
I have UITextFields on a table to enter values. Some of these fields accept
I have a weird behaviour that has only shown up in the last week.
I have several uitextfields within a view and I would like to disable the
In my application I have a UITextField inside a UITableViewCell . If I click
Let's say I have the following code: IBOutlet UITextField* nameTextField; IBOutlet UILabel* greetingLabel; I'd

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.