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.
Not “variables” as such, but the typical way to store data by name is via an associative data structure, such as
NSMutableDictionary(in ObjC) orstd::unordered_maporstd::map(in C++). Have you investigated those? In particular, for example this approximates what you seem to be trying do:and then, to access values:
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.