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

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

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.

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];

 

  

时间: 2024-08-31 17:04:22

iOS开发笔记 3、iOS基础的相关文章

IOS开发笔记 IOS如何访问通讯录

    IOS开发笔记  IOS如何访问通讯录 其实我是反对这类的需求,你说你读我的隐私,我肯定不愿意的. 幸好ios6.0 以后给了个权限控制.当打开app的时候你可以选择拒绝. 实现方法: [plain] view plaincopy //读取所有联系人      -(void)ReadAllPeoples      {              //取得本地通信录名柄              ABAddressBookRef tmpAddressBook = nil;         

iOS开发笔记--详解UILabel的相关属性设置_IOS

在iOS编程中UILabel是一个常用的控件,下面分享一下UILabel的相关属性设置的方法. 很多学习iOS6编程都是从storyboard开始,用到UILabel时是将控件拖到storyboard中生成实现,如果想要在-(void)viewDidLoad中用代码如[_label initWithFrame:CGRectMake(X,Y,WIDTH,HEIGHT)]方法改变拖拽到storyboard的label的大小是行不通的,因为程序加载时先执行了-(void)viewDidLoad的代码,

【Swift】iOS开发笔记(一)

1.隐藏/显示密码功能 光设置secureTextEntry还不行,你会发现UITextField在切换到显示密码时会多一个空字符,看着巨别扭,需要在更改secureTextEntry后进行如下设置:         let pwd = psdField.text         self.psdField.text = pwd + " "         self.psdField.text = pwd 2.获取当前类的名称 String.fromCString(object_get

【Swift 2.2】iOS开发笔记(三)

1.UITableView 中调用 UIButton 的 setTitle 会闪 滚动列表时比较明显,解决办法: buttonType 改成 custom 即可,但是这样一来 UIButton 的高亮效果也没了,但可以自己手动配置 State Config  2.监听 UITextField 文本改变 func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementSt

iOS 开发库(iOS Developer Library)

iOS 开发库(iOS Developer Library) 太阳火神的美丽人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商业用途-保持一致"创作公用协议 转载请保留此句:太阳火神的美丽人生 -  本博客专注于 敏捷开发及移动和物联设备研究:iOS.Android.Html5.Arduino.pcDuino,否则,出自本博客的文章拒绝转载或再转载,谢谢合作. 以下为详尽部分,如感觉过于冗长,可移步<iOS 开发库概要(iOS Devel

iOS开发那些事-iOS网络编程同步GET方法请求编程

iOS SDK为HTTP请求提供了同步和异步请求两种不同的API,而且可以使用GET或POST等请求方法.我们先了解其中最为简单的同步GET方法请求. 为了学习这些API的使用MyNotes"备忘录"应用实例,数据来源于服务器端,而不是本地的Notes.xml(或Notes.json)文件. 首先实现查询业务,查询业务请求可以在主视图控制器MasterViewController类中实现,其中MasterViewController.h代码如下: #import <UIKit/U

IOS开发笔记

1 iphone开发笔记 2 3 退回输入键盘 4 - (BOOL) textFieldShouldReturn:(id)textField{ 5 [textField resignFirstResponder]; 6 } 7 8 CGRect 9 CGRect frame = CGRectMake (origin.x, origin.y, size.width, size.height):矩形 10 NSStringFromCGRect(someCG) 把CGRect结构转变为格式化字符串:

IOS开发笔记整理49之详解定位CLLocation_IOS

在项目功能中有一个定位CLLocation的需求,遇到了一些知识难点,经过各位大侠的帮助,问题解决,特此分享供大家学习,希望大家共同学习进步. 一.简单说明 1.CLLocationManager CLLocationManager的常用操作和属性 开始用户定位- (void)startUpdatingLocation; 停止用户定位- (void) stopUpdatingLocation; 说明:当调用了startUpdatingLocation方法后,就开始不断地定位用户的位置,中途会频繁

iOS开发笔记 2、Cocoa简明

历史 NeXSTEP Many years ago Cocoa was known as NeXTSTEP . NeXT Computer developed and released version 1.0 ofNeXTSTEP in September of 1989, and versions 2.0 and 3.0 followed not far behind (in 1990 and 1992,respectively). In this early phase, NEXTSTEP

iOS开发入门:iOS视图生命周期与视图控制器关系

iOS中视图是一个应用的重要组成部分,功能的实现与其息息相关,而视图控制器控制着视图,其重要性在整个应用中不言而喻. 视图生命周期与视图控制器关系 以视图的5种状态为基础,我们来系统的了解一下视图控制器的生命周期.在视图不同的生命周期,视图控制器会回调不同的方法. 开发入门:iOS视图生命周期与视图控制器关系-"> viewDidLoad方法:视图控制器已被实例化,在视图被加载到内存中的时候调用该方法,这个时候视图并未出现.在该方法中通常进行的是对所控制的视图进行初始化处理. 视 图可见前