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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:58:16+00:00 2026-06-13T14:58:16+00:00

Okay, so i’m trying to give 7 different labels names using an array and

  • 0

Okay, so i’m trying to give 7 different labels names using an array and a for loop.

Code:

id huller[] = {hul18.text, hul17.text, hul16.text, hul15.text, hul14.text, hul13.text, hul12.text, hul11.text, hul10.text, hul9.text, hul8.text, hul7.text, hul6.text, hul5.text, hul4.text, hul3.text, hul2.text, hul1.text};

for (int i = 0;  7 > i; i++) {
    huller[i] = [NSString stringWithFormat:@"%i", x + 1];
    NSLog(@"%@", huller[i]);
}

The name change in the NSLog, but they do not change in the simulator. What is wrong?

  • 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-13T14:58:17+00:00Added an answer on June 13, 2026 at 2:58 pm

    Assuming hul18, hul17, etc. are all UILabel objects, then do this:

    NSArray *labels = [ hul18, hul17, hul16, hul15, hul14, hul13, hul12, hul11, hul10, hul9, hul8, hul7, hul6, hul5, hul4, hul3, hul2, hul1 ];
    
    // Change the text of every label in the array
    for (int i = 0;  i < labels.count; i++) {
        UILabel *label = labels[i];
        label.text = [NSString stringWithFormat:@"%i", x + 1]; // Do you really want 'x' here or 'i'?
        NSLog(@"%@", label.text);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, my code is currently: public MySqlDataReader CreateQuery(string queryString, string connectionString ) { using
Okay, I'm reading about Linux kernel development and there are some code snippets using
Okay so I'm just trying to write some simple code that updates a record
Okay suppose I have an array of objects that look like this: obj(from, to)
Okay so I am developing an advanced framework in PHP using MVC and want
Okay first the code.. <td class=btnSaveBooking> <div class=btnSaveBookingContainder> <div id=save> <span class=btnImage></span><span class=btnsavebookingspan> <input
Okay I'm trying to move from VB to C# with mixed success. I'm getting
Okay, I'm trying to reverse engineer a feature on a website I found -
Okay so here is what I'm trying to accomplish. First of all below table
Okay, I've set up a bit of code which searching for all the pages

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.