天天看點

iOS開發筆記 3、iOS基礎

<b>iPhone</b><b>的規格</b>

Each is a 4.7- or 4.8-ounce computing device. Each contains a 620 MHz ARM CPU that has been underclocked to improve battery performance and reduce heat. The iPhone and iPhone 3G each include 128 MB of dynamic RAM (DRAM) and from 4 to 16 GB of Flash memory. The 3GS received an upgrade to 256 MB of RAM as well as a graphics chip enabling it to run OpenGL ES 2.0.

<b>iPad</b><b>的規格</b>

The iPad weighs in at 1.5 pounds for the wi-fi model and 1.6 pounds for the wi-fi+3G model. Its 9.7-inch LED screen supports a resolution of 1024 x 768 at 132 pixels per inch. The iPad comes in 16 GB, 32 GB, and 64 GB models, all equipped with a 1 GHz A4 custom designed CPU.

iOS開發筆記 3、iOS基礎
iOS開發筆記 3、iOS基礎
iOS開發筆記 3、iOS基礎
iOS開發筆記 3、iOS基礎

知道了這些規格和操作,對軟體的布局和操作設計很有用處

iOS開發筆記 3、iOS基礎

Most of your programming work will be done using the UIKit (UI) or Foundation (NS) frameworks. These libraries are collectively called Cocoa Touch; they’re built on Apple’s modern Cocoa framework, which is almost entirely object-oriented and, in our opinion, much easier to use than older libraries. The vast majority of code in this book will be built solely using Cocoa Touch.

<b>Cocoa Touch </b>It contains the UIKit framework—which is what we spend most of our time on in this book—and the address book UI framework. UIKit includes window support, event support, and userinterface management, and it lets you create both text and web pages. It further acts as your interface to the accelerometers, the camera, the photo library, and devicespecific information.

<b>Media</b> is where you can get access to the major audio and video protocols built into the iPhone and iPad. Its four graphical technologies are OpenGL ES, EAGL (which connects OpenGL to your native window objects), Quartz (which is Apple’s vectorbased drawing engine), and Core Animation (which is also built on Quartz). Other frameworks of note include Core Audio, Open Audio Library, and Media Player.

<b>Core Services </b>offers the frameworks used in all applications. Many of them are data related, such as the internal Address Book framework. Core Services also contains the critical Foundation framework, which includes the core definitions of Apple’s objectoriented data types, such as its arrays and sets.

<b>Core OS</b> includes the kernel-level software. You can access threading, files, networking, other I/O, and memory.

<b>UIKit framework classe</b>

UI開頭的類,如UIView等classes most tightly connected to the devices, including all the graphical classes

<b>Foundation framework classes</b>

NS開頭,主要基本資料結構的支援,如數組,字元串,Url, XML解析等

<b>其他</b>

Address Book framework

Address Book UI framework

<b> </b>

Core Audio framework

Media Player framework

Core Graphics framework

Quartz Core framework

OpenGL ES framework

APNS framework:Push notification services

Map Kit framework: This framework provides you with a simple view that you can add anywhere you want a map to appear.

Store Kit framework: The Store Kit API allows you to sell various items within your application.

Core Foundation framework

Core Location framework

The NS classes come from Core Services’Foundation framework (the Cocoa equivalent of the Core Foundation framework), which contains a huge number offundamental data types and other objects.

根對象NSObject

The second broad category contains the UI classes. These come from Cocoa Touch’s UIKit framework, which includes all the graphical objects you’ll be using as well as all the functionality for the iPhone OS’s event model, much of which appears in UIResponder.

<b>A window </b>is something that spans the device’s entire screen. An application has only one, and it’s the overall container for everything your application does.

<b>A view</b> is the content holder in your application. You may have several of them, each covering different parts of the window or doing different things at different times. They’re all derived from the UIView class. But don’t think of a view as a blank container. Almost any object you use from the UIKit will be a subclass of UIView that features a lot of behavior of its own. Among the major subclasses of UIView are UIControl, which gives you buttons, sliders, and other items with which users may manipulate your program, and UIScrollableView, which gives users access to more text than can appear at once.

<b>A view controller </b>does what its name suggests. It acts as the controller element of the Model-View-Controller triad and in the process manages a view, sometimes called an application view. As such, it takes care of events and updating for your view.

idnewObject = [[objectClassalloc] init];

常見的子類重寫init方法

- (id)init

{

if (self = [super init]) {

// Instance variables go here

}

return self;

帶參數的初始化方法

[[UITextViewalloc] initWithFrame:textFieldFrame];

一個特殊的方法:Interface Builder中使用

initWithCoder:

工廠方法:

[UIButtonbuttonWithType:UIButtonTypeRoundedRect];

iOS開發筆記 3、iOS基礎

繼續閱讀