Programatically added UIButtons keep the background image even after the image is changed or deleted

I have an array of programmatically added buttons in slide-view. Everything is configured and works fine after including my images they show up. But the problem is that when I change the image 1.png with some other (I named it 1.png again) it shows the same image even that it is deleted from my project. I am using ARC... here part of my code:

NSString *imagePath = [[NSString alloc] init];
imagePath = [NSString stringWithFormat:@"%d.png", i];
UIImage *buttonImage = [[UIImage alloc] init];
buttonImage = [UIImage imageNamed:imagePath];
[aButton setImage:buttonImage forState:UIControlStateNormal];

Answers


Try to clean and rebuild the project. Also delete the app from device/simulator before running it again.


Need Your Help

How do I reset a radio button when I press back on the browser

javascript jquery html forms reset

I have a webform for which a user can select 3 different types of delete via a radio button. When then user selects on a different radio button the form changes. This is how it looks.

Call Tumblr API from within a custom theme

javascript api themes tumblr

I'm writing a custom tumblr theme for a client who needs to use the platform.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.