/***********************************************************/
//Creating a New Xcode Project
//
/**********************************************************/
When you create a new iPhone project in Xcode, you can start by using one of the default iPhone application templates or you can choose from one of the ArcGIS project templates that have been provided for you when you installed the SDK.
当你在Xcode中创建来一个新的Ipone工程,你可以使用任何一个默认的ipone应用程序模板或者从ArcGIS 工程模板工程中选择一个,所有的这些模板都是由你安装的SKD提供的。
|
Using ArcGIS Project Templates
The ArcGIS iPhone project templates are a great starting point for developing your iPhone applications. They include a number of project settings that you would need to follow if you were to use one of the default iPhone Application Project Templates (see below for those details).
To get started, first select ArcGIS from the list of User Templates, then select the appropriate(恰当的 vt.侵吞;拨出...供专用) ArcGIS project template and click the Choose... button.
使用ArcGIS 工程模板
ArcGIS Ipone工程模板是你开发ipone应用程序的一个非常好的开始。如果你使用任何一个默认的ipone应用程序模板,他们都已经包含了很多的工程设置,而这些工程中的设置都是你将要遵照的。
为了入门,第一步从用户模板列表中选择一个ArcGIS,然后选择一个专用的ArcGIS 工程模板并单击”Choose…”
|
Once you click Choose, you are ready to start developing your first iPhone application.
Each of the templates configure a number of properties within your Xcode project that you would have to otherwise set up yourself. If you are extending an existing application with ArcGIS functionality, you will need to set up these properties yourself. Those steps are listed below in the details of "Using iPhone Application Project Templates".
If you are just getting started, you may want to walk through the My First iPhone Application.
一旦你单击了Choose,你就准备开始开发你的第一个ipone应用程序了。
每一个模板在你的Xcode工程里面都配置了一定数量的你必须配置的属性,如果不使用默认你就需要亲自配置这些属性。 如果你正在使用ArcGIS 功能对一个已经存在的应用程序进行扩展,你就需要自己配置这些属性。 这些步骤都列在下面"Using iPhone Application Project Templates"详细信息中。
如果你是刚刚开始,你可能想walk through the My First iPhone Application
Using iPhone Application Project Templates
If you do not wish to use the ArcGIS iPhone project templates, you can use one of the default iPhone application project templates. Also if you have created your own iPhone application and wish to add ArcGIS capabilities to it, the following steps are necessary to leverage the ArcGIS APIs.
使用ipone 应用程序工程模板:
如果你不想使用ArcGIS ipone工程模板,你可以使用任何一个默认的ipone应用程序功能模板。 当然,如果你已经创建你自己的ipone应用程序我,并想将ArcGIS 功能添加到你的应用程序,下面的步骤对于影响ArcGIS APIx是必须的。
Choosing a Project Template
When you start Xcode, you will be asked to either create a new project or open an existing project. Click on Create New Project to then choose a project template.
The next step is to then choose a template for your new project. With the iPhone OS application library selected, choose the project template that is best suited for your application design (tab-bar, view-based, etc) and then click "Choose...".
选择一个功能模板:
当你启动Xcode,你会被讯问是创建一个新的工程还是打开一个已经存在的工程。 单击“Create new project ”然后选择一个工程模板。下一步是为你新创建的工程选择一个模板。 随着你选择了Ipone OS 应用程序类库,然后选择一个对你的应用程序设计最合适的一个工程模板最后单击“Choose….”;
|
Add the dependent(依靠的,依赖的;取决于…的) libraries
Once the project has been created, the first step is to additional libraries that the ArcGIS API for iOS is dependent on. These are listed below
- CoreLocation.framework
- QuartzCore.framework
- libz.dylib
To add each dependent library, click the Edit Active Target <Project_Name> from the Project menu to open the Target Info window. From within the Target Info window, select the General Tab and from the Linked Libraries list press the plus button to add each library.
添加依赖的类库
一旦创建了一个工程,第一步就要添加ArcGIS API for iOS基于的类库的。他们在下面列出:
- CoreLocation.framework
- QuartzCore.framework
- libz.dylib
为了添加每一个依赖的类库,单击 Edit Active ,从工程菜单中瞄准<Project_Name>打开目标信息窗口。目标信息窗口中出现表格,选择General tab,从连接的类库的列表中单击Plus按钮添加每一个类。
|
Add the ArcGIS API for iOS library
The ArcGIS library are added to the project in the same way as the project dependencies. Open the Target Info window and select the General Tab. From the linked libraries list press the plus button to add the ArcGIS library.
The ArcGIS library is not in the default list of iPhone SDK libraries so you will need to click the Add Other... button to browse for the libraries.
单击ArcGIS API for IOS类库
使用和添加工程依赖类相似的步骤添加ArcGIS 类库。 打开目标信息窗口,选择Genery tab。从连接的类库列表中单击plus按钮添加ArcGIS 类库。
ArcGIS 类库不在默认的iponeSDK类库列表中,你需要单击add orther..按钮浏览ArcGIS 类库。
|
The iPhone libraries are located at:
~ /Library/SDKs/ArcGIS/iPhoneOS.sdk/usr/local/lib
Add the libArcGIS.a library.
Ipone 类库坐落于~ /Library/SDKs/ArcGIS/iPhoneOS.sdk/usr/local/lib
添加libArcGIS 类库.
Modify the Build Path
It is important that the build process know the library search path for the ArcGIS library that you added. For this to happen, you need to manually add the library path to the project.
Open the Target Info window once again except this tile select the Build tab. Scroll down to the "Library Search Paths", double click on it, and use the plus button to add the following entry:
$(HOME)/Library/SDKs/ArcGIS/${PLATFORM_NAME}.sdk/usr/local/lib
重定义编译路径
编译处理知道你添加的ArcGIS类库的搜索路径是非常重要的,要是搜索成功,你需要手动的添加类库路径到工程中。
再一次的打开目标信息窗口,选择 build tab,滚动到” Library Search Paths”,在上面双击,然后单击plus 按钮添加下面的输入:
$(HOME)/Library/SDKs/ArcGIS/${PLATFORM_NAME}.sdk/usr/local/lib
Add Build Flags to include the iPhone libraries
From within the Target Info window, you will need to add the appropriate build flags to support the ArcGIS library.
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 change its properties.
Press the plus button to add the following linker flags: ' -all_load' and ' -ObjC'. Click Ok when you are done. These are required to properly(.适当地;严格地) load the Objective-C categories (n.种类,类,类别) that are defined in the ArcGIS library.
在木目标信息窗口的表格中,你需要添加build flags 属性来支持ArcGIS 类库。
单击build tab ,在搜索栏里面输入"Other Linker Flags",快速的找到连接的flag 属性。 一旦定位后,在他上面双击,改变它的属性。
单击plus按钮添加下面的linker flags:: ' -all_load' and ' -ObjC'。当你完成上面操作后,单击“OK”。 他们是需要严格加载的Objective-C 种类,这些种类是在ArcGIS 类库中定义的。
Add the ArcGIS for iPhone header files to the Search path
From within the Target Info windo, 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/${PLATFORM_NAME}.sdk/usr/local/include/**
目标窗口的表格中,你需要添加头文件到搜索路径支持ArcGIS类库。
单击build tab并在Search bar中输入"User Header Search Paths",一旦定位后,在上面双击改变它的属性。
单击plus按钮,添加后面的路径:
$(HOME)/Library/SDKs/ArcGIS/${PLATFORM_NAME}.sdk/usr/local/include/**
Note:
The ** at the end of path indicates that it is recursive
With these steps complete, you are now ready to start developing your iPhone application!
注意:路径最后的**指定了她的recursive
伴随着这些操作步骤的完成,你现在已经准备好了开始开发你的ipone应用程序了。