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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:52:32+00:00 2026-06-03T05:52:32+00:00

Is it possible to do something along the lines of : Entity [NSString stringWithFormat:@Entitiy%i,entitiesCreated];

  • 0

Is it possible to do something along the lines of :

 Entity [NSString stringWithFormat:@"Entitiy%i",entitiesCreated];

to create a variable called Entity1, Entity2, Entity3, Entityn?
I dont care how i go about doing it, i just need something that resembles variably named variables. They will be added to an array, if thats of any use.

  • 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-03T05:52:34+00:00Added an answer on June 3, 2026 at 5:52 am

    Not “variables” as such, but the typical way to store data by name is via an associative data structure, such as NSMutableDictionary (in ObjC) or std::unordered_map or std::map (in C++). Have you investigated those? In particular, for example this approximates what you seem to be trying do:

    NSMutableDictionary* dict = [NSMutableDictionary dictionaryWithCapacity:1];
    [dict addObject:somevalue forKey:[NSString stringWithFormat:@"Entity%i",entitiesCreated]];
    

    and then, to access values:

    id val = [dict valueForKey:@"Entity1"];
    

    or so.

    I assume you’re coming from another programming language such as JavaScript or PHP where such associative data structures are used for holding all variables – this is not the case in C-derived languages, where variables are statically allocated. You have to explicitly create any dynamic data structures.

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

Sidebar

Related Questions

I am wondering if something along the lines of the following is possible in
Is it possible to do something along those lines: DELETE TOP(1) m FROM MyTable
Is it possible to do something along the lines of: type t = int;//this
Is it possible to do a bulk insert with Sitecore Rocks? Something along the
is it possible to create something like a global dictionary for pspell? I tried
I'm pretty sure I saw on a Rails related site something along the lines
using something along the lines of: background:url(data:image/gif;base64,R0lGODlhIwAhALMAAAAAADQ0NENDQ25ubouLi6ioqLa2ttPT0/Dw8P///wAAAAAAAAAAAAAAAAAAAAAAACwAAAAAIwAhAAAIpQABCBxIsCCAAAYTKlw4cECCAQwjMnSY4KHEiwQpVrSIUaLGjRw7Kvy4EYEAkSNBljyJ0iDJiiZbulQJk6XMhjQTxLyJk+ZOngBe6rTJU+jPojmTKqXZc6nTpAKFPp0qsMDUqyoHWsWKleBWrk8LfgV5AKjYnGXNakWrdi3NtG3HbjTQtmrOAnUByK2It+7eBH3j5iSQVy5cv3PzegWsuCDExmYDAgA7) no-repeat center center;} is fine but I
I'm looking for something along these lines: <TextBlock Grid.Column=1 Text=Welcome, {Binding UserName}! /> This
I've something along this lines: public class Something { private IDictionary<object,Activity> fCases; public IDictionary<object,Activity>
Is it possible in C# to create an array of unspecified generic types? Something

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.