10. Using Yocto-GPS with Objective-CObjective-C is language of choice for programming on Mac OS X, due to its integration with theCocoa framework. In order to use the Objective-C library, you need XCode version 4.2 (earlierversions will not work), available freely when you run Lion. If you are still under Snow Leopard, youneed to be registered as Apple developer to be able to download XCode 4.2. The Yoctopuce libraryis ARC compatible. You can therefore implement your projects either using the traditional retain /release method, or using the Automatic Reference Counting.Yoctopuce Objective-C libraries1 are integrally provided as source files. A section of the low-levellibrary is written in pure C, but you should not need to interact directly with it: everything was done toensure the simplest possible interaction from Objective-C.You will soon notice that the Objective-C API defines many functions which return objects. You donot need to deallocate these objects yourself, the API does it automatically at the end of theapplication.In order to keep them simple, all the examples provided in this documentation are consoleapplications. Naturally, the libraries function in a strictly identical manner if you integrate them in anapplication with a graphical interface. You can find on Yoctopuce blog a detailed example2 with videoshots showing how to integrate the library into your projects.10.1. Control of the Latitude functionLaunch Xcode 4.2 and open the corresponding sample project provided in the directory Examples/Doc-GettingStarted-Yocto-GPS of the Yoctopuce library.#import #import "yocto_api.h"#import "yocto_gps.h"static void usage(void){NSLog(@"usage: demo ");NSLog(@" demo ");NSLog(@" demo any (use any discovered device)");exit(1);}int main(int argc, const char * argv[]){1 www.yoctopuce.com/EN/libraries.php2 www.yoctopuce.com/EN/article/new-objective-c-library-for-mac-os-xwww.yoctopuce.com 67