Reading through an instruction manual for iPhone development, I found a simple example of how to manually create an array of image names using code:
NSArray *hopAnimation;
hopAnimation=[[NSArray alloc] initWithObjects:
[UIImage imageNamed
"frame-1.png"],
[UIImage imageNamed
"frame-2.png"],
etc....
nil];
imageView.animationImages=hopAnimation;
imageView.animationDuration=1;
[hopAnimation release];
This was a fun exercise and provided me with an idea of animating a variety of scenes. I stored image file names in a SQLITE database table. I perform a method call to read the table and create an array of file names based on a specific scene reference number. When I return from the method call, I have an array of image file names sorted in the correct order.
What I am trying to do is read the array, build another array using the format shown above and then pass the array to imageView.animationImages and animate the list of file names. If the user selects a different scene, the method call to the SQLITE database table uses a different key in the select, pulls the appropriate files into an array and the process starts again. However, when I get the array back from the method call, I can determine the count of the array but I can not figure out how to read the values of the file names to construct the
[UIImage imageNamed: (value placed here from array)
in order to get the files to animate.
Thanks in advance for any assistance.
NSArray *hopAnimation;
hopAnimation=[[NSArray alloc] initWithObjects:
[UIImage imageNamed
[UIImage imageNamed
etc....
nil];
imageView.animationImages=hopAnimation;
imageView.animationDuration=1;
[hopAnimation release];
This was a fun exercise and provided me with an idea of animating a variety of scenes. I stored image file names in a SQLITE database table. I perform a method call to read the table and create an array of file names based on a specific scene reference number. When I return from the method call, I have an array of image file names sorted in the correct order.
What I am trying to do is read the array, build another array using the format shown above and then pass the array to imageView.animationImages and animate the list of file names. If the user selects a different scene, the method call to the SQLITE database table uses a different key in the select, pulls the appropriate files into an array and the process starts again. However, when I get the array back from the method call, I can determine the count of the array but I can not figure out how to read the values of the file names to construct the
[UIImage imageNamed: (value placed here from array)
in order to get the files to animate.
Thanks in advance for any assistance.