I have this little bit of code that where i am trying to check to see if there is a duplicate file name, but may have a different path. Meaning two files named the same thing but reside in a different location on their hard drive were added into my application. Now when I am checking for those things the inside loop seems to have variables out of scope and not checking them correctly.
In sample code there is a Category that has a NSMutableArray of a class called Pictures. Pictures has FileName and FullPath on it.
In sample code there is a Category that has a NSMutableArray of a class called Pictures. Pictures has FileName and FullPath on it.
HTML:
for ( Category * info in [CategoriesController arrangedObjects])
{
for (PictureInfo * pictureOne in [info Pictures])
{
NSString * fileName = pictureOne.FileName;
NSString * fullPath = pictureOne.FullPath;
for (PictureInfo * pictureTwo in [info Pictures])
if (pictureTwo.FileName == fileName && pictureTwo.FullPath != fullPath)
[validationitems addObject:[ValidationItem InitWithValues: [NSString stringWithFormat:@"It appears you have multiple images in Category %@ that has the same name of %@. This will very difficult for your customer to relay the correct image when ordering proofs. Please rectify and resubmit.",info.Description, pictureTwo.FileName] button:button]];
}
}