I’m sure this is a very basic procedure, so excuse this newbie question.
How would I initialize several objects, with the same code, but each with a unique name? I can make a string to represent theName, but how would I apply that as the actual objects name? Can I rename the object?
BTW the purpose is so that I can perform operations on each object referring to them by name, at a later time… I think that unique names would be a solution to this issue…
NSString *theName = [NSString stringWithFormat:@"textView%d",tvNum];
tvNum ++;
UITextView *myTextView = [[UITextView alloc] initWithFrame:CGRectMake(self.view.bounds.size.width /2, self.view.bounds.size.height /2, 100, 100)];
[self.view addSubview:myTextView];
NSString *theText = [[NSString alloc] initWithString:@"string"];
[myTextView setText:theText];
You can add tags to your controller later to refer it.
and later by matching that tag value with controller you can do what you want