I have some uiButtons in my table view and i want to load them with images which i get from an array. But i am not able to add images to the button using the array and it is crashing my entire app. Can anyone provide me the solution of how to add images to buttons in table view using Array of Images.Any help will be appreciated.
This method is called from a loop where i am passing a button as the parameter
-(void)setImage1:(UIButton *)button
UIButton *newButton=[[UIButton alloc]init];
newButton=button;
[newButton setImage:[NSString stringWithFormat:@"%d.png", j] forState:UIControlStateNormal]; j++; }
Thanks,
Christy
Show us some code at least for more help.
You should not create the button within that method. Create it in ViewDidLoad, or even better, in Interface builder. If you create a button programatically you will have to also make sure you enable user interaction, and then set its frame and add it to the view.