I have one NSArray
with names in string objects like this:@[@\"john\", @\"smith\", @\"alex\",
@\"louis\"]
, and I have another array that contains
NSArray *array1 = [NSArray arrayWithObjects:@"a", @"u", @"b", @"v", @"c", @"f", nil];
NSMutableArray *mainArray = [NSMutableArray arrayWithObjects:@"a", @"u", @"I", @"G", @"O", @"W",@"Z",@"C",@"T", nil];
int j=0;
for(int i=0; i < mainArray.count; i++)
{
if (j < array1.count)
{
for( j=0; j <= i; j++)
{
if([[mainArray objectAtIndex:i] isEqualToString:[array1 objectAtIndex:j]] )
{
NSLog(@"%@",[mainArray objectAtIndex:i]);
}
}
}
}