Search code examples
iosmethodscompiler-errorsxcode6.1

Xcode 6.1 : Multiple methods named 'count' found with mismatched result, parameter type or attributes


I'm getting Multiple methods named 'count' found with mismatched result, parameter type or attributes error while building app. The app was working fine in 32 bit. I have changed it to 64 bit as per Apple guideline. I have referred this Link but don't got any help.

I have tested app on multiple devices on simulator. It works fine on 32 bit but prompts error in 64 bit. Why is this so?

 -(void)serviceSuccessFulForPatientSelect:(id)response
{
    [self hideOverlay];
    if([response isKindOfClass:[NSArray class]])
    {
        if([response count]>0)
        {
            if(1)
            {
               ...
            }
        }
    }
    [refillDetailTable reloadData];

}

Error


Solution

  • Solution 1: I had declared count as property in a view controller. I renamed it to CountValue and the problem got solved.

    Solution 2: You can type-cast to appropriate datatype.

    if([(NSArray *) response count]>0) {
      ...
    }
    

    This solution was not feasible in my case since there were 1000s of place containing [response count].