Can any one tell me what is wrong with this code?
Only the else part is not working, if I have an image for the note, every thing is working just perfect, but when i am trying to show the “no_image” image, i just don’t see it (there is not error). Looks like a “nil”, but the image is in the project, for sure. i am using the same image in other places and other methods and it is working over there. just in the UIButton not working.
//setting the note header data
if (note.imageThumb) {
[photoButton setImage:note.imageThumb forState:UIControlStateNormal];
} else {
[photoButton setImage:[UIImage imageNamed:@"no_image.png"] forState:UIControlStateNormal];
}
Thank you,
Erez
I’ve solved the problem.
When using setImage, I am getting nil.
When using setBackgroundImage I am getting the image.
Used the background, It is great for this, and doesn’t matter in this case, I think the issue is with the size of the button and the size of the thumb.
Thank you all,
Erez