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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:09:25+00:00 2026-05-27T02:09:25+00:00

I am using a for statement to enumerate all objects in the array. For

  • 0

I am using a for statement to enumerate all objects in the array. For each object in the array I want to make it so that it creates a different object each time so i can refer to different ones e.g. there are 5 string objects in an array. I use the for statement to enumerate each object and each time i want to create an nsmutablestring that contains the text @”hello”

for (NSString *string in array) {

 // Ignore string variable
 NSMutableString *
 // I have this problem, how do I code it so that it makes a new                                               NSMutableString with a separate name that i can specify 
 // so i can refer to it
  = [NSMutableString alloc] init];

   // More code that is not relevant

}

In case you did not understand here is it briefly….
In an array – 5 objects
enumerate the array and create a new object each time with a separate name so i can refer to it:
object1
object2
object3
object4
object5

Update:

By array i mean NSArray

my problem is that it I’m adding uiimageview…

  • 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-27T02:09:26+00:00Added an answer on May 27, 2026 at 2:09 am

    I’m not sure to get your question…
    Array objects are already uniquely identified by their index.
    Why do you need different names (NSString * pointers) ???

    This could be relevant in the case when you already know how many strings there are in this array, and what each of them represent. (for example, an array of strings representing some configuration parameters for a programm… if anyone thinks of a better example 🙂
    In this case, if you want to have a clear and distinct way to access each member of an array, you don’t need different pointer names, just use int constants for indexes of the array – (declared in C macros, or in an enum for example)

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

Sidebar

Related Questions

C# has the using statement, specifically for IDisposable objects. Presumably, any object specified in
I want to use using statement purely for scope management. Can I omit holding
Does Java have a using statement that can be used when opening a session
'using' statement guaranteed that for the object will be called Dispose method. In this
I saw this C# using statement in a code example: using StringFormat=System.Drawing.StringFormat; What's that
Is it safe to use the using statement on a (potentially) null object? Consider
If you call a constructor from a within a using statement the object is
Can you explan anonymous type in usage of using statement? can you explan pros
The using(...) statement is syntactic sugar for try{} finally {}. But if I then
I have used the using statement in both C# and VB. I agree with

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.