Skip to content
This repository has been archived by the owner on Mar 17, 2019. It is now read-only.

Setting up Your App with the iSENSE Library

Rajia edited this page Sep 30, 2014 · 4 revisions

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.

Section 1: setting up the library and bundle

  1. Navigate to the library xcodeproj file found in the iOS repository at /Libs/iSENSE_API/iSENSE_API.xcodeproj and open it.
  2. Click once on the project and open the iSENSE_API target. Navigate to the Build Settings tab.
  3. 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.
  4. Under Build Options, ensure the Compiler is set to the Default compiler (Apple LLVM 5.1).
  5. 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).
  6. Under Linking, ensure Other Linker Flags has the value -ObjC.
  7. Under Search Paths, ensure Header Search Paths contains the values $(inherited) and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include.
  8. Now switch over to the Build Phases tab, still in the iSENSE_API target.
  9. The iSENSE_API_Bundle should be listed under Target Dependencies.
  10. Every .m file in the library must be listed under Compiler Sources.
  11. Every .h file in the library must be listed under Copy Headers.
  12. Switch the target to the iSENSE_API_Bundle, and go to the Build Settings tab.
  13. Follow steps 4, 5, and 7 for the iSENSE_API_Bundle, then switch to the Build Phases tab.
  14. 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.
  15. 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.

Section 2: setting up your application

  1. Create a new iOS application using any of XCode's default templates and save it in the /Apps subdirectory of your iOS repository clone.
  2. Add a new group to the application. Call it something appropriate like "iSENSE API," "iSENSE Library," "API," "Library," "IS Static Lib," etc.
  3. 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.
  4. Click on your application and go to your app's target, followed by the Build Settings tab.
  5. Under Linking, set the Other Linker Flags to -ObjC -all_load
  6. 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).
  7. Go to the Build Phases tab.
  8. Under Target Dependencies, click the + icon and add the iSENSE_API library.
  9. Under Link Binary With Libraries, click the + icon and add libiSENSE_API.a, SystemConfiguration.framework, MobileCoreServices.framework, and CoreData.framework.
  10. 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.