Foundation framework-Structural body

Source: Internet
Author: User

First, the basic knowledge

foundation-basic framework. The framework contains many of the data types commonly used in development, such as structs, enumerations, classes, etc., which are the basis of other iOS frameworks.

If you want to use the data type in the foundation framework, the main header file containing it is available.

namely #import <Foundation/foundation.h>

Add: The Core Foundation framework is relatively low-level, and the code inside is almost all C-language, and the foundation is OC.

Second, the general introduction of the structure and simple use

Commonly used structures:

(i) basic use of Nsrang

Creating variables

(ii) Use of Nspoint/cgpoint

(iii) Use of nssize/cgsize

(iv) Use of Nsrect/cgrect

General usage:

In development, you want to validate the value of a property in a struct, how should I print it?

The frame function is used to transform the corresponding structure into a string, and then the string can be printed directly.

(v) some commonly used structural functions in the foundation framework

Add 1: Import Framework Build Phase->link (+)

Add 2:the coordinates origin in iOS is in the upper left corner.

Foundation framework-Structural body

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.