iOS rookie notes (3)--Stanford Open Class (1)

Source: Internet
Author: User
Tags posix

First, iOS four layer structure


1. Core OS

Darwin, rewritten with FreeBSD and Mach, is an open source, POSIX-compliant UNIX core. This layer includes or provides some basic features of the entire iphone OS, such as: Hardware driver, memory management, program management, thread Management (POSIX), File system, network (BSD Socket), and standard input and output, all of which are provided through the C language API. Also, it is worth noting that this layer has the most Unix color, and if you need to port the programs developed on UNIX to the iphone, you will probably use the core OS API.

2. Core Service

Core Services provides richer functionality on core OS, including Foundation.framework and core Foundation.framework, which is called Foundation, It is because it provides a series of basic functions to deal with strings, permutations, combinations, calendars, times, and so on. The foundation is the Api,core fundation belonging to Objective-c, which belongs to the C API. In addition, Core Servieces offers other features such as Security, Core location, SQLite, and Address Book. Where security is used to handle authentication, password management, security management, Core location is used to handle GPS positioning, Sqllite is a lightweight database, and addressbook is used to process phone book data.

3. Media

Like its name, the media layer provides multimedia features such as pictures, music, and movies. The image is divided into 2D images and 3D images, the former is supported by quartz2d, while the latter is opengles. The module that corresponds to music is core audio and OpenAL, Media player implements the playback of the movie, and finally provides the core Animation to support the powerful animations.

4. Cocoa Touch

The top layer is the cocoa touch, which is the Objective-c API, the most central part of which is uikit.framework, the various components of the application interface, all provided by it to provide rendering, in addition to it is also responsible for processing on-screen multi-touch events, the output of the text , images, Web page display, camera or file access, and acceleration sensing parts.

Second, MVC in iOS


As shown, we will divide into three parts, the white split line means that it can be accessed directly, and the yellow split line means that it cannot be accessed directly.

We now want to access the properties in a view uiview, we need to use outlet for direct access, if there are certain events in the view (such as click, Swipe) to notify the controller (controllers) need to be accessed by action or delegate way, The model data changes are broadcast to notify the controller.

Third, the first objective-c focus and points of attention

We created a new Card class containing two files (Card.h files and card.m files)

* * Card.h is a public statement, CARD.M is a private implementation


As shown, a private declaration can be declared in the card.m file.

* * Point syntax only applies to Getter and setter methods (other methods with a return value of void are syntax warnings only, but are not recommended)

* * Objective-c and Java are different because properties cannot be accessed directly through point syntax (the point syntax is actually called Getter and setter methods)

For other syntax please refer to the series "Objective-c Basic Notes"

iOS rookie notes (3)--Stanford Open Class (1)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.