i want below array(10 elements) to be sorted ascending order of
"/Users/bkothari/Library....Photo-0.png" to be 0th element
of an array and so on
I have tried to use
NSArray *sorted = [profileImageArray sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
if ([obj1 intValue] < [obj2 intValue]) return NSOrderedAscending;
else return NSOrderedDescending;
}];
but its not working.
profileImageArray (
"/Users/bkothari/Library/Application Support/iPhone Simulator/7.0/Applications/233D4F5D-CDB0-4D55-8037-5DD674558BB0/Documents/MyFolder/Photo-4.png",
1,
1,
1,
1,
1,
1,
1,
"/Users/bkothari/Library/Application Support/iPhone Simulator/7.0/Applications/233D4F5D-CDB0-4D55-8037-5DD674558BB0/Documents/MyFolder/Photo-1.png",
"/Users/bkothari/Library/Application Support/iPhone Simulator/7.0/Applications/233D4F5D-CDB0-4D55-8037-5DD674558BB0/Documents/MyFolder/Photo-0.png"
)
Final output required:
profileImageArray (
"/Users/bkothari/Library/Application Support/iPhone Simulator/7.0/Applications/233D4F5D-CDB0-4D55-8037-5DD674558BB0/Documents/MyFolder/Photo-0.png",
"/Users/bkothari/Library/Application Support/iPhone Simulator/7.0/Applications/233D4F5D-CDB0-4D55-8037-5DD674558BB0/Documents/MyFolder/Photo-1.png",
1,
1,
"/Users/bkothari/Library/Application Support/iPhone Simulator/7.0/Applications/233D4F5D-CDB0-4D55-8037-5DD674558BB0/Documents/MyFolder/Photo-4.png",
1,
1,
1,
1,
1
)
NSNumericSearchoption?Photo-0.png, Photo-1.png, Photo-2.png?