after a decent search and could not find solution (probably i missed something...):
i have an array with objects, the object is AddressCard
and one if the properties is name
.
so i send to my function string and with for statement looking all the matches inside my object collection array who contain AddressCArd object (bookArray) and if there is match i want to add this object to an array asnd return this array:
-(NSMutableArray *) lookup:(NSString *) name
{
NSMutableArray arr = [NSMutableArray array];
for(AddressCard *card in bookArray}
{
if([card.name rangeOfString: name].location == NSNotfound)
{
[arr addObject: card];
}
}
return arr;
}