I am doing a children’s book using Leaves. I want to have a different animated image and sound play for each page. I have figured out how to do the animation, I have it in a method that i can pass all the animation objects for each page. But each page is so different that I am ending up writing a different method for each page. I have a pageNum var that I want to call each pages method page 5 animation method would be -(void)animatePage5, and so on.
But I can not figure out how to build the method call so that it has the pageNum object in it.
I know this is easy, but I just can not find an answer on google, or stack overflow.
I might be too close to the forest to see the trees.
What is the simple, best practice for this type of method call.
Thanks for helping out a noob….
You could use a switch statement to redirect the method call to the right method:
Or you can create a string and then convert it to a @selector: