Say I have the following function that returns a CLLocationCoordinate2D
, which is just a struct
that has two double
s (named longitude
and latitude
) in it:
- (CLLocationCoordinate2D)getCoordinateForHouse:(House *)house
{
CLLocationCoordinate2D coordToReturn;
coordToReturn.latitude = // get house's latitude somehow
coordToReturn.longitude = // get house's longitude somehow
return coordToReturn;
}
Can I basically treat this struct
just like any other primitive type? For instance, if I call the function above in code somewhere else like this:
CLLocationCoordinate2D houseCoord =
[someClassThatTheAboveFunctionIsDefinedIn getCoordinatesForHouse:myHouse];
The value that was returned from the function is simply copied into houseCoord
(just like any other primitive would act), right? I don't have to worry about the CLLocationCoordinate2D
ever being destroyed elsewhere?
Seems obvious to me now that this is probably the case, but I just need confirmation.