-
Notifications
You must be signed in to change notification settings - Fork 4
Setting up Your App with the iSENSE Library
This wiki page will talk about setting up the iSENSE iOS static library, located at /Libs/iSENSE_API, along with the associated resources bundle to work in conjuction with your iOS mobile application. Section 1 discusses setting up the library itself. If you are developing an application to use this library, you may skip section 1 and move immediately to section 2, which will discuss how to import the library into your application. A separate wiki page will discuss how to access particular objects in the library as well as resources in the bundle.
Note: these instructions were written with XCode 5.1.1 and may become out of date in later versions, so please be aware of this.
- Navigate to the library xcodeproj file found in the iOS repository at /Libs/iSENSE_API/iSENSE_API.xcodeproj and open it.
- Click once on the project and open the iSENSE_API target. Navigate to the Build Settings tab.
- Under Architectures, ensure that active architectures are set as the Standard Architectures, the base SDK is the latest version of iOS, and the Build Active Architecture Only boolean is set to No.
- Under Build Options, ensure the Compiler is set to the Default compiler (Apple LLVM 5.1).
- Under Deployment, ensure Skip Install is set to No and the iOS Deployment Target is set to iOS 5.1 (since we are supporting iOS 5.1 and later).
- Under Linking, ensure Other Linker Flags has the value -ObjC.
- Under Search Paths, ensure Header Search Paths contains the values $(inherited) and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include.
- Now switch over to the Build Phases tab, still in the iSENSE_API target.
- The iSENSE_API_Bundle should be listed under Target Dependencies.
- Every .m file in the library must be listed under Compiler Sources.
- Every .h file in the library must be listed under Copy Headers.
- Switch the target to the iSENSE_API_Bundle, and go to the Build Settings tab.
- Follow steps 4, 5, and 7 for the iSENSE_API_Bundle, then switch to the Build Phases tab.
- Under Compile Sources, the QDataSetModel.xcdatamodeld must be listed and contained in the iSENSE_API_Bundle subdirectory, located at /Libs/iSENSE_API/iSENSE_API_Bundle.
- Under Copy Bundle Resources, every image and xib in the library must be listed and contained in the iSENSE_API_Bundle subdirectory.
If any settings were changed, ensure you clean and rebuild the library. If you intend on testing any significant changes to the library from an application that imports the library, it is advised you also uninstall any previous version of the application from the testing device.
- Create a new iOS application using any of XCode's default templates and save it in the /Apps subdirectory of your iOS repository clone.
- Add a new group to the application. Call it something appropriate like "iSENSE API," "iSENSE Library," "API," "Library," "IS Static Lib," etc.
- Navigate to the iSENSE_API.xcodeproj file in your file explorer, located under /Libs/iSENSE_API, and drag it under the group you created in step 2. You should now see the iSENSE_API.xcodeproj in your application and it should be expandable.
- Click on your application and go to your app's target, followed by the Build Settings tab.
- Under Linking, set the Other Linker Flags to -ObjC -all_load
- Under Search Paths, add to the Header Search Paths the values
$(PROJECT_DIR)/../../Libs/iSENSE_API and $ (PROJECT_DIR)/../../Libs/iSENSE_API/headers. Do the same for User Header Search Paths, and also add $(BUILD_PRODUCTS_DIR). - Go to the Build Phases tab.
- Under Target Dependencies, click the + icon and add the iSENSE_API library.
- Under Link Binary With Libraries, click the + icon and add libiSENSE_API.a, SystemConfiguration.framework, MobileCoreServices.framework, and CoreData.framework.
- Under Copy Bundle Resources, you will need the iSENSE_API_Bundle.bundle. The easiest way to get this in here is to expand the iSENSE_API.xcodeproj, open the Product subdirectory, and drag the iSENSE_API_Bundle.bundle file into your project's target's Copy Bundle Resources.
All set! You should be able to include header files and use the classes from the library as well as access resources in the bundle.