IKImageBrowser loads files in reverse order?

321 views Asked by At

I have an IKImageBrowser that loads images from the resources directory located inside the app. For some reason, the order it loads the file is in reverse, for example I have images 1-74, but they get loaded 74-1, any ideas?

Project is based off of the IKImageKit Demo.

1

There are 1 answers

0
Anne On BEST ANSWER

Simple and 'ugly' solution:

// File: ControllerBrowsing.m:
// Function: - (void) addImagesFromDirectory:(NSString *) path

// Find:
for(i=0; i<n; i++)

// Replace with:
for(i=n-1; i>=0; i--)

Good solution (one of the many possibilities):

  1. Create a new NSMutableArray.
  2. Loop through the NSArray that contains the files.
  3. Add the paths to the NSMutableArray.
  4. Sort the NSMutableArray the way you like.
  5. Loop trough the NSMutableArray and add the items.