iOS开发笔记 3、iOS基础

简介: 系统规格 iPhone的规格 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.

系统规格

iPhone的规格

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.

iPad的规格

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.

image

image

image

image

知道了这些规格和操作,对软件的布局和操作设计很有用处

iOS的结构

image

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.

Cocoa Touch 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.

Media 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.

Core Services 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.

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

iOS中的类

UIKit framework classe

UI开头的类,如UIView等classes most tightly connected to the devices, including all the graphical classes

Foundation framework classes

NS开头,主要基本数据结构的支持,如数组,字符串,Url, XML解析等

其他

Address Book framework

Address Book UI framework

 

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

NS CLASS

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 UI CLASSES

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.

Window , View, view controllers

A window 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.

A view 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.

A view controller 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];

 

  image

相关文章
|
1月前
|
API 数据安全/隐私保护 iOS开发
利用uni-app 开发的iOS app 发布到App Store全流程
利用uni-app 开发的iOS app 发布到App Store全流程
85 3
|
3月前
|
存储 iOS开发
iOS 开发,如何进行应用的本地化(Localization)?
iOS 开发,如何进行应用的本地化(Localization)?
122 2
|
3月前
|
存储 数据建模 数据库
IOS开发数据存储:什么是 UserDefaults?有哪些替代方案?
IOS开发数据存储:什么是 UserDefaults?有哪些替代方案?
39 0
|
3月前
|
安全 编译器 Swift
IOS开发基础知识: 对比 Swift 和 Objective-C 的优缺点。
IOS开发基础知识: 对比 Swift 和 Objective-C 的优缺点。
91 2
|
3月前
|
API 开发工具 iOS开发
iOS 开发高效率工具包:10 大必备工具
iOS 开发高效率工具包:10 大必备工具
47 1
|
3月前
|
API 数据安全/隐私保护 iOS开发
利用uni-app 开发的iOS app 发布到App Store全流程
利用uni-app 开发的iOS app 发布到App Store全流程
54 1
|
6天前
|
API 定位技术 iOS开发
IOS开发基础知识:什么是 Cocoa Touch?它在 iOS 开发中的作用是什么?
【4月更文挑战第18天】**Cocoa Touch** 是iOS和Mac OS X应用的核心框架,包含面向对象库、运行时系统和触摸优化工具。它提供Mac验证的开发模式,强调触控接口和性能,涵盖3D图形、音频、网络及设备访问API,如相机和GPS。是构建高效iOS应用的基础,对开发者至关重要。
11 0
|
21天前
|
开发工具 Swift iOS开发
利用SwiftUI构建动态用户界面:iOS开发新范式
【4月更文挑战第3天】 随着苹果不断推进其软件开发工具的边界,SwiftUI作为一种新兴的编程框架,已经逐渐成为iOS开发者的新宠。不同于传统的UIKit,SwiftUI通过声明式语法和强大的功能组合,为创建动态且响应式的用户界面提供了一种更加简洁高效的方式。本文将深入探讨如何利用SwiftUI技术构建具有高度自定义能力和响应性的用户界面,并展示其在现代iOS应用开发中的优势和潜力。
|
1月前
|
iOS开发
iOS自动混淆测试处理笔记
iOS自动混淆测试处理笔记
12 0
|
2月前
|
监控 API Swift
用Swift开发iOS平台上的上网行为管理监控软件
在当今数字化时代,随着智能手机的普及,人们对于网络的依赖日益增加。然而,对于一些特定场景,如家庭、学校或者企业,对于iOS设备上的网络行为进行管理和监控显得尤为重要。为了满足这一需求,我们可以利用Swift语言开发一款iOS平台上的上网行为管理监控软件。
196 2