I am using two arrays:
var facebookFriends: [FacebookFriend] = []
var friendsToInvite: [FacebookFriend]!
The first array contains all the Facebook friends and the second one contains objects FacebookFriend which have selected in a different ViewController.
Both of the arrays are instantiated correctly in the ViewController.
In the -tableView:cellForRowAtIndexPath delegate method I want to change the cell view if the Facebook friend from the facebookFriends array is contained in the friendsToInvite array.
In order to acheive that, I have tried the following:
if(friendsToInvite.contains(facebookFriends[indexPath.row])) {
// Code to change the view of the cell
}
But I get the following error:
Cannot subscript a value of type '[FacebookFriend]'.
Is there any other way to check if this object is contained in the array?