Performance Problem while retrieving custom objects from array
I create a custom object that has some properties like ID and Title,description etc... 

And I add it to an array. (That array may contains more than 500 values).

And I use the following code to retrieve custom objects,

    -(CustomObjects *)getObjectWithId:(int)id    {
        
        CustomObjects *objCustomObjects = nil;
        
        for (CustomObjects *customObjects in arrayCustomObjects)  {
            
            if (customObjects.id == id) {
                
                objCustomObjects = customObjects;
                break;
            }
        }
        
        
        return objCustomObjects;
    }

But It has some performance problem, because I use the function to call on UIScrollview pinch.


**How can I improve performance in fetching the objects?**

thanks in advance,
Performance Problem while retrieving custom objects from array
===

I create a custom object that has some properties like ID and Title,description etc... 

And I add it to an array. (That array may contains more than 500 values).

And I use the following code to retrieve custom objects,

    -(CustomObjects *)getObjectWithId:(int)id    {
        
        CustomObjects *objCustomObjects = nil;
        
        for (CustomObjects *customObjects in arrayCustomObjects)  {
            
            if (customObjects.id == id) {
                
                objCustomObjects = customObjects;
                break;
            }
        }
        
        
        return objCustomObjects;
    }

But It has some performance problem, because I use the function to call on UIScrollview pinch.


**How can I improve performance in fetching the objects?**

thanks in advance,