没有合适的资源?快使用搜索试试~ 我知道了~
首页iOS 4开发入门:探索SDK创建应用指南
"《探索iOS SDK:入门iPhone 4应用开发》是一本旨在引导初学者进入iOS应用程序开发领域的实用指南。作者Dave Mark、Jack Nutting和Jeff LaMarche深入浅出地介绍了如何为iPhone、iPad和iPod touch创建应用程序。该书特别关注于iOS 4 SDK的最新改进,这标志着移动开发平台的新高度,其优雅且文档齐全的工具使开发者能够轻松上手。 本书的首要目标是帮助读者度过初期的学习曲线,使他们能够掌握iOS应用程序的工作原理以及构建流程。随着读者的逐步学习,他们将亲手制作一系列小型应用程序,每个项目都聚焦于展示特定的iOS功能,并演示如何操控和互动。通过实践,读者不仅能提升技术技能,还能了解如何利用SDK中的各种API和框架,如UIKit、Core Data、MapKit等,来设计用户友好的界面和实现复杂的功能。 书中详细讲解了如何设计UI(用户界面),处理多线程和网络通信,管理数据存储,以及遵循苹果的设计准则来确保应用与iOS生态系统无缝融合。此外,读者还将了解到如何进行应用程序测试、调试和发布流程,以便他们的作品能在App Store上成功上线。 《探索iOS SDK:入门iPhone 4开发》不仅适合对iOS开发感兴趣的初学者,也适合有一定经验的开发者寻求更新的技术知识和最佳实践。通过阅读这本书,开发者可以快速掌握iOS开发的基础,为在这一极具吸引力的移动平台上创造创新应用打下坚实的基础。"
资源详情
资源推荐
CHAPTER 2: Appeasing the Tiki Gods
15
Figure 2–1. The Xcode welcome window. Note that if this is the first time you are running Xcode, there will be no
recent projects. This will change as you make your way through the book.
NOTE: If you have an iOS device connected to your machine, you might see a message when you
first launch Xcode asking whether you want to use that device for development. Alternatively, a
window titled Organizer, designed to list the devices you’ll be working with, might appear. For
now, click the Ignore button or, in the case of the Organizer window, close the window. If you
choose to join the paid iOS Developer Program, you will gain access to a program portal that will
tell you how to use your iOS device for development and testing.
Create a new project by selecting File ➤ New Project..., or by pressing N, which will
bring up the New Project assistant (see Figure 2–2). The pane on the left side of the
sheet is divided into two main sections: iOS and Mac OS X.
CHAPTER 2: Appeasing the Tiki Gods
16
Figure 2–2. The New Project assistant, which lets you select from various file templates when creating a new
project
As shown in Figure 2–2, select Application under the iOS heading, and you’ll see a
number of icons in the upper-right pane, each of which represents a separate project
template that can be used as a starting point for your iOS applications. The icon labeled
View-based Application is the simplest template and the one we’ll be using for the first
several chapters. The others provide additional code and/or resources needed to create
common iOS application interfaces, as you’ll see in later chapters.
Click the View-based Application icon (as in Figure 2–2), and then select iPhone from the
Product popup menu in the middle of the window. This tells Xcode that we’ll be
targeting this particular app at the iPhone and its particular sized screen. As of this
writing, the iPhone and iPad are the only iOS devices supported by this template. For
now, we’ll stick with the iPhone. No worries, we’ll get to the iPad later in the book.
To continue, click the Choose… button. You’ll be asked to save your new project using
the standard save sheet (see Figure 2–3). Type Hello World for the project name, and
save it wherever you want it stored. The Document folder is not a bad place, but you
might want to create a dedicated folder for your Xcode projects.
CHAPTER 2: Appeasing the Tiki Gods
17
Figure 2–3. Selecting the name and location for your project
The Xcode Project Window
After you click Save, Xcode will create and then open your project, and a new project
window will appear that looks like Figure 2–4. We find that the project window, when
first created, is a little small for our tastes, so we usually expand the window to take up
more of the screen. There’s a lot of information crammed into this window, and it’s
where you will be spending a lot of your iOS development time.
Figure 2–4. The Hello World project in Xcode
CHAPTER 2: Appeasing the Tiki Gods
18
Your project window features a toolbar across the top, which gives you ready access to
a lot of commonly used commands. Below the toolbar, the window is divided into three
main sections, or panes.
The pane that runs down the left side of the window is called the Groups & Files pane.
All of the resources that make up your project are grouped here, as are a number of
relevant project settings. Just as in the Finder, clicking the little triangle to the left of an
item expands that item to show available subitems. Click the triangle again to hide the
subitems.
The top-right pane is called the Detail View (or just Detail pane) and shows you detailed
information about items selected in the Groups & Files pane. The lower-right pane is
called the Editor pane. If you select a single file in either the Groups & Files or Detail
pane and Xcode knows how to display that kind of file, the contents of the file will be
displayed in the Editor pane. Editable files, such as source code, can also be edited
here. In fact, this is where you will be writing and editing your application’s source code.
Now that we have the terminology out of the way, take a look at the Groups & Files
pane. The first item in the list should bear the same name as your project, in this case,
Hello World. This item is the gathering point for the source code and the other resources
specific to your project. For the time being, don’t worry about the items in the Groups &
Files pane except those under Hello World.
Take a look at Figure 2–4. Note that the disclosure triangle to the left of Hello World is
open, and there are five subfolders: Classes, Other Sources, Resources, Frameworks,
and Products. Let’s briefly talk about what each subfolder is used for:
Classes is where you will spend much of your time. This is where most
of the code that you write will go, since this is where all Objective-C
classes rightfully belong. You are free to create subfolders under the
Classes folder to help organize your code. We’ll be using this folder
starting in the next chapter.
Other Sources contains source code files that aren’t Objective-C
classes. Typically, you won’t spend a lot of time in the Other Sources
folder. When you create a new iPhone application project, there are
two files in this folder:
Hello_World_Prefix.pch: The extension .p
ch stands for
“precompiled header.” This is a list of header files from external
frameworks that are used by our project. Xcode will precompile
the headers contained in this file, which will reduce the amount
of time it takes to compile your project whenever you select Build
or Build and Go. It will be a while before you have to worry about
this, because the most commonly used header files are already
included for you.
main.m: This is where your application’s main() function is. You
normally won’t need to edit or change this file.
CHAPTER 2: Appeasing the Tiki Gods
19
Resources contains noncode files that will be included as part of your
application. This is where you will include files such as your
application’s icon image and other images, sound files, movie files,
text files, or property lists that your program may need while it’s
running. Remember, since your application runs in its own sandbox,
you will have to include any files you need here, because you won’t be
able to access files located elsewhere on the iPhone except through
sanctioned APIs, such as the ones that provide access to the iPhone’s
photo library and address book. There should be three items in this
folder:
Hello_WorldViewController.xib: This file contains information
used by the program Interface Builder, which we’ll take for a spin
a bit later in this chapter.
MainWindow.xib: This is your application’s main Interface Builder
(or “nib”) file. In a simple application like the one we’re building in
this chapter, there’s often no need to touch this file. In later
chapters, when we design more complex interfaces, we will work
with this file and look at it in more depth.
Hello_World-Info.plist: This is a property list that contains
information about our application. We’ll look at this file a little bit
later in the chapter too.
Frameworks are a special kind of library that can contain code as well
as resources such as image and sound files. Any framework or library
that you add to this folder will be linked in to your application, and your
code will be able to use objects, functions, and resources contained in
that framework or library. The most commonly needed frameworks
and libraries are linked in to our project by default, so most of the time,
we will not need to do anything with this folder. Less commonly used
libraries and frameworks, however, are not included by default, and
you will see how to link to them into an application later in this book.
Products contains the application that this project produces when it is
compiled. If you expand Products, you’ll see an item called Hello
World.app. This is the application that this particular project creates.
Hello World.app is this project’s only product. Right now, Hello
World.app is listed in red, which means that the file cannot be found,
which makes sense, since we haven’t compiled our project yet!
Highlighting a file’s name in red is Xcode’s way of telling us that it
can’t find the underlying physical file.
剩余673页未读,继续阅读
凌潇子
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- AirKiss技术详解:无线传递信息与智能家居连接
- Hibernate主键生成策略详解
- 操作系统实验:位示图法管理磁盘空闲空间
- JSON详解:数据交换的主流格式
- Win7安装Ubuntu双系统详细指南
- FPGA内部结构与工作原理探索
- 信用评分模型解析:WOE、IV与ROC
- 使用LVS+Keepalived构建高可用负载均衡集群
- 微信小程序驱动餐饮与服装业创新转型:便捷管理与低成本优势
- 机器学习入门指南:从基础到进阶
- 解决Win7 IIS配置错误500.22与0x80070032
- SQL-DFS:优化HDFS小文件存储的解决方案
- Hadoop、Hbase、Spark环境部署与主机配置详解
- Kisso:加密会话Cookie实现的单点登录SSO
- OpenCV读取与拼接多幅图像教程
- QT实战:轻松生成与解析JSON数据
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功