NSString *q = @"Day";
NSArray *shu = [NSArray arrayWithObjects:[NSString stringWithFormat:@"%@1",q];
[[self.shu objectAtIndex:0] setText: @"HI"];
In the following code I have an array that I am filling up with NSStrings. What I am trying to do is fill up the array with a UITextfield objects not a string of the name. Is it possible to convert a string to a object UITextfield? Something like this:
NSString *q = @"Day";
NSArray *shu = [NSArray arrayWithObjects:[NSObject namewithFormat:@"%@1",q];
[[self.shu objectAtIndex:0] setText: @"HI"];
EDIT: What I want to do is using this code:
for (int i=1; i<=5; ++i) {
NSArray *shu = [NSArray arrayWithObjects:[NSString stringWithFormat:@"TextField%d1",i],[NSString stringWithFormat:@"TextField%d2",i];
}
Make it so that when i = 1 then:
NSArray *shu = @[Textfield11,Textfield12];
And when i = 2 then:
NSArray *shu = @[Textfield21,Textfield22];