Add NSTimer to NSArray with UIImages?

"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!

I believe the problem is that imageCount is being set to 1 each time you call the method associated with the timer. Try declaring imageCount in the header file as something like int imageCount remove imageCount = 1 from the animateFunction method and place it in the viewDidLoad or some similar method to initialize it. Then when you iterate imageCount (which you can substitute imageCount = imageCount + 1 with just imageCount if you like), it will add 1 to the variable properly instead of returning 2 each time (which is what the current method does).

If you need the images to loop, you will need to set up a check that resets the imageCount like the following: if (imageCount == yourMaxNumber) { // set the image count back to initial value; imageCount = 1; } else { imageCount++; } Hopefully that does the trick for you.

I believe the problem is that imageCount is being set to 1 each time you call the method associated with the timer. Try declaring imageCount in the header file as something like int imageCount;, remove imageCount = 1; from the animateFunction method and place it in the viewDidLoad or some similar method to initialize it. Then when you iterate imageCount (which you can substitute imageCount = imageCount + 1 with just imageCount++ if you like), it will add 1 to the variable properly instead of returning 2 each time (which is what the current method does).

If you need the images to loop, you will need to set up a check that resets the imageCount like the following: if (imageCount == yourMaxNumber) { // set the image count back to initial value; imageCount = 1; } else { imageCount++; } Hopefully that does the trick for you.

I have a quick question : I cannot set the image at every regular interval of 3 secs from NSTimer. I changed my logic as per your request and have edited my question as above but whenever NSTimer calls the function it does not set the image correctly. – lifemoveson Nov 8 at 22:48 What exactly is happening?

In other words, what exactly do you see going on and what do you want to see? The more detail, the better. Then we can get everything giong just how you want – slev Nov 9 at 2:53 actually currently I am trying to change the image after every interval of 3 secs using NSTimer for self setCellIconNames:NSArray arrayWithObjects:NSString stringWithFormat:@"image%i.

Png", imageCount. The image name changes after each 3 secs. I am trying to add the changing images in cellForRowAtIndexPath but it never gets set after 3 secs.

I have edited my question more by keeping cellForRowAtIndexPath. – lifemoveson Nov 9 at 16:02 Just to make sure I understand, you have a 3 second timer that switches images. When the image changes, you want it to set the images of the imageView in a tableViewCell.

If so, just add self. YourTableView reloadData. You can call reloadRowsAtIndexPaths:withRowAnimation: if you only have a select few rows to update, but if there aren't many rows in the first place, it won't make any significant difference and reloadData will be fine.It just sounds to me like you are updating the image, but not updating the cells – slev Nov 9 at 23:28.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions