I tried something like
//Putting the sentence into array
NSString *list = (@"A book costs £50., Ken has saved £45., How much more does he need to save to buy the book?");
NSArray *listItems = [list componentsSeparatedByString:@", "];
But the result wasn’t what I want. I want each frame will contain a word. eg [A] [book] [costs] …etc
// to create a frame
CGRect frame= CGRectMake(50, 60, 50, 50);
comp *newBox = [[comp alloc] initWithFrame:frame ];
[self.view addSubview:newBox];
newBox.backgroundColor=[UIColor blueColor]
This frame work fine, i just need to put the word in to each frame
Try this