Jayprakash Dubey Jayprakash Dubey - 1 year ago 48
iOS Question

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

Answer Source

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].

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download