views:

334

answers:

1

i looked at the example from the iphone dev: http://developer.apple.com/iphone/library/samplecode/Scrolling/index.html

everything looks cool except that for 5 image they set the "const NSUInteger kNumImages = 5;"

what happens is that what if i have 1000 images?and i wan to view it without having to change the number everytime?also if i will to set the number to 1000 and i have only 10 images then in the simulator the user can scroll "blank view" till it reaches count 1000!

help please..thanks

A: 

That constant is in there as a placeholder. You create your own integer to use programmatically with something like: NSInteger myImageCount = 100;

And you can modify that amount later. The only thing kNumImages is used for in that example is to determine the content size and the for loop.

mjdth