I’ve got a simple array of objects..
NSEnumerator * enumerator = [someArray.childItems objectEnumerator];
ChildItem* childItem;
while(childItem = [enumerator nextObject])
{
someArray.total = someArray.total + childItem.SomeAverage;
}
someArray.total is a float, so is childItem.SomeAverage.
When I try to compile, I get:
invalid operands to binary + (have ‘float *’ and ‘float *’)
What does this mean?
Thanks in advance
It means your arguments are both
float *, not float, and you can’t add pointers together like that. 🙂 (You can subtract pointers, though, but that’s a different discussion unless you want to get into it.) You haven’t shown the declarations so hard to say more.P.S. You don’t need to use that enumerator syntax in “modern” Obj-C (2.0). You can write: