我也刚开始从Java往Objective-C转,大家一起来学习吧!
自己根据一些电子书编写的Iphone SDK to Ipad 教程。
转载请说明出处,谢谢!

Charpter1

1.了解iphoneSDK

Obta ining the iPhone SDK

如果要成为Ipad开发者,你需要到Iphone Developer网站去注册,并且成为会员。http://developer.apple.com/iphone/program/start/register/.

注册是免费的,但是如果你要将你写好的ipad程序放到Appstore卖钱,那就要注册成为正式开发元,会员费99刀!

NOTE:Ipad用的是和iphone和ipod一样的系统。

 下载最新的Iphone SDK 目前版本4

 在你安装好你的SDK前,你最好升级你的系统,如果是VM安装的MAC系统,那考验你主机的时候到了!最好i5以上,4G内存!

新版本的iPhoneSDK包含了一整套开发Ipad、Iphone、IPod的工具,帮助你开发你的应用程序:

Xcode — Integrated development environment (IDE) 完整的开发环境能让你充分管理、编辑、编译你的项目.

Dashcode — 老九的理解即使面板式开发,让用户自我创建 Widget。

iPhone Simulator — Iphone、Ipad模拟器,可以快捷的子模拟器上Run你写好的程序

Interface Builder — 可视化编程工具,和Microsoft的VisualStudio系列类似

Instruments — 帮助你的程序最优化的分析工具,包括内存监控

Xcode

启动Xcode, (/Developer/Applications folder)最好是在Dock上做一个链接,方便一点。

Xcode的欢迎界面,看到这个很高兴!

[iPad开发书籍大全].Beginning.iPad.Application.Development(Wrox.bmp

创建一个你自己的Ipad程序,点 击Create a new Xcode project,进入程序类型选择界面,你可以看到在窗口的左边有你所开发的程序类型的选择,有Iphone os,有Mac osX,当然我们选择Iphone os。再选择View-based Application。

1-5.bmp

好到这里我们暂时等等,先讲下面的

 2.iphone(Ipad)模拟器

模拟器是个十分有用、而且高效的工具,打开模拟器在/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications 文件夹里面

这是个Simulator模拟 器,而不是emulator仿真器。它能做一切真实iphone或者ipad能做的事情,而且有很多版本可以选择,可以选择os版本,从3.0到3.4, 硬件选择可以选择iphone或者ipad。Simulator可以在MAC环境下很好的模拟真实的iphone或者ipad终端,从而快捷的进行程序的 显示和修改。

将程序从模拟器里删除和在显示用的使用是一样的,用鼠标按住你所安装的软件,等待图片抖动后出现X标记,点击X标记就可以删除,删除后程序所对应的文件夹也一并删除

3.IphoneSDK的框架

Interface Builder

可视化编程可以让我们在用户界面中进行ipad程序编程,能拖动窗口对程序界面进行设计,在代码和页面之间建立链接,能适时反应出代码对程序的影响和作用。

这就是标准的interface Builder界面

1-6.bmp

1-6.bmp

Mac os X与 iphone os区别

1-13.bmp

底层都为Core OS,它是程序的基础,它负责管理内存、文件系统、其它系统任务,,直接和硬件进行通信,Core OS包括:

 

OS X Kernel
Mach 3.0
BSD
Sockets
Security
Power Management
Keychain
Certificates
File System
Bonjour

 

OS X Kernel

Mach 3.0

BSD

Sockets

Security

Power Management

Keychain

Certificates

File System

Bonjour

Core Services layer为Core OS layer提供一个对象服务,它提供对Iphone OS服务的基本的通信,主要由以下部分组成:

 

Collections

Address Book

Networking

File Access

SQLite

Core Location

Net Services

Threading

Preferences

URL Utilities

The Media layer主要为你的Ipad应用提供多媒体应用服务,它包括:

 

Core Audio

OpenGL

Audio Mixing

Audio Recording

Video Playback

JPG, PNG, TIFF

PDF

Quartz

Core Animation

OpenGL ES

The Cocoa Touch layer为Ipad程序提供多种对象函数库应用,如:

 

Multi-Touch events

Multi-Touch controls

Accelerometer

View Hierarchy

Localization

Alerts

 

Web Views

People Picker

Image Picker

Controllers

Iphone SDK由多种Frameworks(框架)组成:framework 是一种特殊功能的软件函数库

Framework Name Description

AddressBook.framework Provides access to the centralized database for storing a user’s contacts.

AVFoundation.framework Provides low-level C APIs for audio recording and playback, as well as for managing the audio hardware.

 AudioToolbox.framework Provides low-level C APIs for audio recording and playback, as well as managing the audio hardware.

AudioUnit.framework Provides the interface for iPhone OS-supplied audio processing plug-ins in your application.

AVFoundation.framework Provides low-level C APIs for audio recording and playback, as well as for managing the audio hardware.

CFNetwork.framework Provides access to network services and configurations, such as HTTP, FTP, and Bonjour services.

CoreAudio.framework Declares data types and constants used by other Core Audio interfaces.

CoreData.framework Provides a generalized solution for object graph management in your application.

CoreFoundation.framework Provides abstraction for common data types, Unicode strings,XML, URL resource, and so on.

CoreGraphics.framework Provides C-based APIs for 2D rendering; based on the Quartz drawing engine.

CoreLocation.framework Provides location-based information using a combination of GPS,cell ID, and Wi-Fi networks.

ExternalAccessory.framework Provides a way to communicate with accessories.

 Foundation.framework Provides the foundation classes for Objective C, such as NSObject, basic data types, operating system services, and so on.

GameKit.framework Provides networking capabilities to games; commonly used for peer-to-peer connectivity and in-game voice features.

IOKit.framework Provides capabilities for driver development.

MapKit.framework Provides an embedded map interface for your application.

MediaPlayer.framework Provides facilities for playing movies and audio files.

MessageUI.framework Provides a view-controller–based interface for composing e?mail

messages.

MobileCoreServices.framework Provides access to standard types and constants.

OpenAL.framework Provides an implementation of the OpenAL specification.

OpenGLES.framework Provides a compact and efficient subset of the OpenGL API for 2D and 3D drawing.

QuartzCore.framework Provides ability to configure animations and effects and then render those effects in hardware.

Security.framework Provides the ability to secure your data and control access to software.

StoreKit.framework Provides in-app purchase support for applications.

SystemConfiguration.framework Provides the ability to determine network availability and state on device.

UIKit.framework Provides the fundamental objects for managing an application’s UI.

4.屏幕分辨率的说明

Ipad屏幕为1024*768,程序显示区域为1004*768,横向以此计算。

1-14.jpg

5.单线程窗口说明

如果你有一个新的移动应用程序,必须限制其在基本版面全屏幕显示,Ipad程序也不例外。

也不允许有后台程序,因为Iphone OS为单线程系统,这样可节约更多的内存、更多的电力。水果公司就这样定义它的程序,我们不遵守没有办法,除非越狱!

好了,本小节介绍了Iphone SDK的基础,下一节开始,我们来设计我们的第一个应用程序,Hollow World!