문제

i have 10 uibuttons on story board and i've linked them with iboutletcollections. Then i set buttons backgroundimage from array of uiimage using loop. When i run my project button indexes differs from image indexes


Here is my code

-(void)setButtonImages
{ 
  for (int i=0; i<imageArray.count; i++)
  {
    UIButton *b =[self.myButtons objectAtIndex:i];
    [b setBackgroundImage:[imageArray objectAtIndex:i] forState:UIControlStateNormal];
  }
}
도움이 되었습니까?

해결책

create your buttons manually then tag them one by one and you can use your buttons with tag

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top