Long and short is I wrote the following method which involves a pointer argument. Since the argument can be of different classes, I thought an id would be the best idea, but it gives me warnings for passing NSString and NSDictionary classes into the method. The exact warning is "Passing argument 3 of firstValueWithLabel:::' from incompatible pointer type."
Now the program still runs the way I want and expected it to do, so I really don't understand the warning, but I want to be aware if there's something that could cause issues down the road with this program.
Here's the code of the parts in question.
And here's one of the lines where I call the method.
Now the program still runs the way I want and expected it to do, so I really don't understand the warning, but I want to be aware if there's something that could cause issues down the road with this program.
Here's the code of the parts in question.
Code:
-(BOOL)firstValueWithLabel:(ABMultiValue *)multiValue:(NSString *)label:(id **)result{
int x;
for (x=0; x<[multiValue count]; x++) {
if ([[multiValue labelAtIndex:x] isEqual:label]) {
*result = [multiValue valueAtIndex:x];
return true;
}
}
return false;
}
And here's one of the lines where I call the method.
Code:
[self firstValueWithLabel:multiValue:kABEmailWorkLabel:&email]