0

I have Two NSMutableArray .My First Array contain 3 UIButtons along With Buttons Titles and My Second Array contain 50 UIButtons .But all these 50 UIButtons have random alphabet as a Title.here is my first Array code.

  NSMutableArray *buttons = [NSMutableArray arrayWithObjects:btn1, btn2, btn3, nil];
        [btn1 setTitle:@"stack" forState:UIControlStateNormal]; 
        [btn2 setTitle:@"over" forState:UIControlStateNormal]; 
        [btn3 setTitle:@"flow" forState:UIControlStateNormal]; 

Now i want to Assign my first button title which is "stack" to second Array buttons using index 3-7 .second button title which is "over" to Second Array buttons using index 15-18 and Third button title which is "flow" to scond Array buttons using index 30-33. please any one suggest a solution for me.thanx

jamil
  • 2,419
  • 3
  • 37
  • 64
  • 2
    Its difficult to understand what exactly you want to do. please elaborate your question. – iMash May 16 '12 at 07:44
  • Thanx @ mihirios for quick response ..please just check this link here i post question with detail.http://stackoverflow.com/questions/10596414/put-random-uibuttons-title-of-nsmutablearray-to-uibuttons-of-nsmutablearray – jamil May 16 '12 at 07:47

1 Answers1

1
for (int i=3; i<=7; ++i) {
    UIButton *temp = [stack objectAtIndex:i];
    [temp setTitle:@"Temp" forState:UIControlStateNormal];

As an example for one. Now repeat for your other indexes :)

Martol1ni
  • 4,684
  • 2
  • 29
  • 39
  • Thanx @Martol 1ni for quick response.your code solve my Index problem.but if you check this link then i hope you can understand my problem.Thanx http://stackoverflow.com/questions/10596414/put-random-uibuttons-title-of-nsmutablearray-to-uibuttons-of-nsmutablearray – – jamil May 16 '12 at 12:04