在IOS上利用ArcGIS API For IOS进行移动GIS开发新建程序的配置步骤
2012-08-23 14:32
405 查看
程序demo下载地址:http://www.arcgis.com/home/group.html?owner=iOSDevelopmentTeam&title=ArcGIS%20for%20iOS%20Developer%20Samples
Configuring an Xcode Project
Resource Center » GettingStarted
Xcode is the defacto Integrated Development Environment (IDE) for developing iOS applications. Xcode can be downloaded separately or as part of the iOS SDK from Apple's iOS Dev Center. Both Xcode 3.2 and Xcode 4 are supported. At the time of writing this document,
Xcode 4.2 was the most recent version available and supported.
You can create a new project using one of the built-in iOS project templates and then configure it to begin development with ArcGIS Runtime SDK for iOS.The following steps describe the project settings
that need to be configured.
Note:
Some of you may notice that ArcGIS specific Xcode project templates are no longer available. This is because 3rd party project templates are not officially supported by Xcode.
1. Add ArcGIS library
Xcode 4
To add the ArcGIS library to your project, select the project node in the left Navigator pane, select a target node, and choose the Build Phases tab. Under the Link Binary with Libraries section, click onthe + button to add the ArcGIS library.
you picked the default location while installing the ArcGIS Runtime SDK for iOS.
Note:
The ${HOME}/Library folder is hidden by default in Mac OS X Lion. You can issue the command chflags nohidden ~/Library/ in the terminal to unhide it.
Xcode 3
To add the ArcGIS library to your project, choose the the Edit Active Target <Project_Name> options from the Projectmenu. This should open the Target Info window.From within the Target Info window, select the General tab. Press the + button under the Linked Libraries section to add the ArcGIS library.
The ArcGIS library is not in the default list of iOS libraries so you will need to click the Add Other... button to browse for the library. The library is typically located at ${HOME} /Library/SDKs/ArcGIS/iOS.sdk/usr/local/lib if
you installed the ArcGIS API in the default location.
2. Modify the build path
Note:
If you're using Xcode 4.2, you can skip this step. Xcode would have automatically configured the build path for you when you added the ArcGIS library in the previous step.
Adding the ArcGIS library to your project references is not enough. You also need to provide the path to this library so that your project can be built correctly.
Xcode 4
Under the Build Settings tab, type "Library Search Paths" in the Search bar to quickly find the Library Search Paths setting. Double click in the empty space under the target column, and use the plus buttonto add the following entry:
$(HOME)/Library/SDKs/ArcGIS/iOS.sdk/usr/local/lib
Xcode 3
Open the Target Info window once again except this time select the Build tab. Scroll down to the Library Search Paths, double click on it, and use the plus button to add the followingentry:
$(HOME)/Library/SDKs/ArcGIS/iOS.sdk/usr/local/lib
3. Add dependent libraries
The ArcGIS library in turn depends upon the following frameworks and libraries which need to be added to your project's settings.CoreGraphics.framework
CoreLocation.framework
Foundation.framework
QuartzCore.framework
UIKit.framework
CoreText.framework (dependency introduced at v1.8)
libstdc++.dylib (dependency introduced at v1.8)
MediaPlayer.framework (dependency introduced at v2.0)
MobileCoreServices.framework (dependency introduced at v2.0)
libz.dylib (dependency introduced at v2.1)
Security.framework (dependency introduced at v2.1)
Xcode 4
Select the Build Phases tab. Under the Link Binary with Libraries section, click on the + button, select and add each dependency.
Xcode 3
Select the Edit Active Target <Project_Name> option from the Project menu. This should open the Target Info window. From within the Target Info window, select the General tab.Click on the + button under the Linked Libraries section, select and add each dependency.
4. Modify build flags
ArcGIS library is an Objective-C library. You need to add some build flags to your project to ensure that the Objective-C categories defined in the library are loaded correctly.Note:
Without these flags, your application may crash while trying to use classes from the ArcGIS API.
Xcode 4
Under the Build Settings tab, type "Other Linker Flags" in the Search bar to quickly find the Other Linker Flags setting. Double click in the empty space under the target column, and use the plus buttonto add the following entries : -all_load and-ObjC . Click Done when you are finished.
Xcode 3
To add the flags, open the Target Info window, Click on the Build tab and in the Search bar type "Other Linker Flags" to quickly find the linker flag properties. Once located, double-click on it to changeits properties.
Press the plus button to add the following linker flags: -all_load and -ObjC. Click Ok when you are done.
5. Add ArcGIS header files to the search path
Xcode 4
Under the Build Settings tab, type "User Header Search Paths" in the Search bar to quickly find the User Header Search Paths setting. Double click in the empty space under the target column, and use theplus button to add the following entry:
$(HOME)/Library/SDKs/ArcGIS/iOS.sdk/usr/local/include/**
Xcode 3
From within the Target Info window, you will need to add the header files to the search path to support the ArcGIS library.Click on the Build tab and in the Search bar type "User Header Search Paths". Once located, double-click on it to change its properties.
Press the plus button to add the following path:
$(HOME)/Library/SDKs/ArcGIS/iOS.sdk/usr/local/include/**
6. Add Resource Bundle
API resources such as images for the Esri and Bing logo, GPS location, etc have been consolidated into an ArcGIS.bundle file. This bundle is installed under ${HOME}/Library/SDKs/ArcGIS/iOS.sdk/user/local/resources. You need to manually add it to your projectas described below.
To use custom images instead of the ones provided with bundle, add the custom images to your project making sure they have the same name as the images in the bundle. Images in your project will take precedence over those in the bundle.
Xcode 4
Go to the XCode application's File menu, select the Add Files to <project> item, browse to the location ${HOME}/Library/SDKs/ArcGIS/iOS.sdk/user/local/resources, select the ArcGIS.bundle file, and click Add.
XCode 3
Go to the XCode application's Project menu, select the Add to project item, browse to the location ${HOME}/Library/SDKs/ArcGIS/iOS.sdk/user/local/resources, select the ArcGIS.bundle file, click Add,and then click Addagain.
a map to display in your application.
Note:
Configuring a new project as described above can be a little tedious, especially if you have to do it repeatedly. For your convenience, we provide a pre-configured project with the SDK installed under ${HOME}/Library/SDKs/Samples/MapViewDemo.
This sample is minimal and only contains the code to display a full screen map. You can easily make a copy of this project and then rename it to quickly begin development on a new application.
详情可参照http://help.arcgis.com/en/arcgismobile/10.0/apis/iOS/2.1/concepts/index.html#/Configuring_an_Xcode_Project/00pw00000044000000/
相关文章推荐
- 南沙政府应急系统之GIS一张图(arcgis api for flex)讲解(一)GIS一张图的系统开发环境以及flexviewer框架
- 利用XCode来进行IOS的程序开发
- ArcGIS API for javascript开发笔记(二)——解决ArcGIS Service中的服务在内网环境下无法进行javascript预览问题
- ArcGIS For Silverlight API 开发中利用WebService调用ArcObjects
- ArcGIS API for javascript开发笔记(二)——解决ArcGIS Service中的服务在内网环境下无法进行javascript预览问题
- 使用ArcGIS API for Flex构建Android和iOS移动地图应用程序
- ArcGIS for iOS 开发系列(2) – 开发环境配置
- ArcGIS API for Silverlight开发入门(8):在程序中使用Virtual Earth的服务
- 利用Android与iOS系统进行移动应用开发:浅析开发过程及人员招募
- arcgis api for silverlight开发系列之一:平台搭建及第一个应该用程序
- 使用ArcGIS API for ios开发时的一些经验与问题
- arcgis api for flex开发环境配置与调试
- ArcGIS API for Silverlight开发入门(8):在程序中使用Virtual Earth
- ArcGIS for Java_ArcGIS API for Flex 开发环境的配置
- ArcGIS API for Silverlight开发入门(8):在程序中使用Virtual Earth的服务
- ArcGis For Silverlight API,地图显示Gis,绘制点,线,绘制图等(二)--Silverlight 配置动态的 webService、动态加载ArcGis地图服务
- 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(一)GIS一张图的系统开发环境以及flexviewer框架
- ArcGIS API for Silverlight开发入门(9)外传:在程序中调用AO