I need to add objects selected by UIImagePickerController into an NSMutabeArray, the code goes as:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[picker dismissModalViewControllerAnimated:YES];
if(![imagesArray containsObject:[info objectForKey:@"UIImagePickerControllerOriginalImage"]])
{
[imagesArray addObject:[info objectForKey:@"UIImagePickerControllerOriginalImage"]];
}
else {
//some procedures
}
}
The problem is that it always fells into the if block and never executes the else block when picking same images repeatedly. Any clue over this would be appreciated.