From: Panayotis K. <pan...@pa...> - 2010-11-08 10:13:38
|
Hello all! I am implementing CoreLocation library (actually it is ready and working) but I'd like your opinion about one thing. Here http://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocation_Class/CLLocation/CLLocation.html#//apple_ref/doc/uid/TP40007126-CH3-SW27 is a list of constant double values. These values define the accuracy of the location, and I found that they have meaningful values (i.e kCLLocationAccuracyNearestTenMeters is 10, kCLLocationAccuracyKilometer is 1000 etc). I have created a class containing these static values, but since these are double values and not integers, it is always possible that equality might not work as expected. I tried to check every one of them with something like java_value == kCLLocationAccuracy_value and they all seem OK. On the other hand, it might be possible to create a wrapper method that returns this value, i.e. something like public static double Kilometer () { .. } in java and + (double) Kilometer__ { return kCLLocationAccuracyKilometer; } in obj-c, and use the static methods instead. This might be safer but it is slower. Since the "constant variable" solution works fine, I'd rather prefer that solution. What do you think? |