i have a dynamically made prototype:
typedef double ICEDouble;
-(BOOL) getPosition:(SyDRpcInterfacePositionType)type longitude:(ICEDouble *)longitude latitude:(ICEDouble *)latitude;
and i would call it so, because i have no plan, how to do it in the right way:
NSNumber* longitudeReturn;
NSNumber** latitudeReturn;
[prx getPosition:SyDRpcInterfaceMAPMATCHED longitude:longitudeReturn latitude:latitudeReturn];
the compiler says:
warning: passing argument 2 of 'getPosition:longitude:latitude:' from incompatible pointer type
warning: passing argument 3 of 'getPosition:longitude:latitude:' from incompatible pointer type
not really surprising, but can anyone please tell me how to do it right ?
maybe with a little explanation for a beginner ?
Assuming
ICEDoubleis typedef’d to `double’, it looks like the method you are calling has two ‘out’ parameters. It should be called like this:This is a common idiom when a method needs to return multiple values, without object overhead. If needed, you can then convert these to
NSNumbers if you need them, via:Check the return type of
getPosition:though. If it returns aBOOLyou will want to check the result before using the returned values. Otherwise,latandlongwill represent garbage values.