this is my first question.
I am trying to programmatically change the background image of a UIButton but there is a problem, I can’t find the key of the background image.
To understand, this is my code:
[[self.view viewWithTag:69000+i] setValue:[UIImage imageNamed:[NSString stringWithFormat:@"%d-options.png", i+1]] forKey:@"backgroundImage"];
When this is executed, the app crashes. Giving this error:
Thread 1: signal SIGTRAP in main.m
and in the debugger: (lldb)
So, in case I am right and the crash is caused by the incorrect key (backgroundImage), what is the key that refers to background image?
Thank you very much!!
PD: I need this done by self.view viewWithTag……
And why don’t you use this :