I have NSMutableArray that hold sorted(time) objects. each object has unique URL string ID.
From performance perspective, what is better approach ?
- using filteredArrayUsingPredicate to check if object URL is already exist if not add to array.
- using NSMutableDictionary and NSMutableArray. each time I add an object that not exist, I also store it in the dictionary. before adding new object, I'll check the NSDictionary key if the object id exist.
I think using NSDictionary for checking is less expensive, but I prefer to understand why.
Is there better approach for this case ? Thanks in advance.