I want to use the segment control to change the image in a uimage view, I store my images in an array.
What is the best way of going about this when thinking of memory? Basically I want a forward button and a back button in the segment view, and for that to change the image on screen, cycling through the array depending on what button has been clicked.
I was thinking maybe have the buttons in the segment control ++; or –; an int, and for that to change what image shows.
Any thoughts or ideas for the most efficient way to do this please? Any one know if this has been done before or has any links to something similar?
This doesn’t answer your question as your wrote it, but it expands on what @borrrden said in the comment. Use
UIButtons.You can do something like this in your
forwardmethod assumingcountUpis anint:And then just reverse it for the
backbutton.